当前位置:论坛首页 > Linux面板 > 讨论

【已回应】PM2管理器 2.6.2 重启任务丢失问题

发表在 Linux面板2019-8-13 13:59 [复制链接] 1 1203

系统环境:
ubuntu16.04

pm2默认生产的启动脚本为
  1. /etc/systemd/system/pm2-undefined.service
复制代码
  1. [Unit]
  2. Description=PM2 process manager
  3. Documentation=https://pm2.keymetrics.io/
  4. After=network.target

  5. [Service]
  6. Type=forking
  7. User=undefined
  8. LimitNOFILE=infinity
  9. LimitNPROC=infinity
  10. LimitCORE=infinity
  11. Environment=PATH=/www/server/nvm/versions/node/v10.16.2/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/root/bin:/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
  12. Environment=PM2_HOME=/root/.pm2
  13. PIDFile=/root/.pm2/pm2.pid
  14. Restart=on-failure

  15. ExecStart=/www/server/nvm/versions/node/v10.16.2/lib/node_modules/pm2/bin/pm2 resurrect
  16. ExecReload=/www/server/nvm/versions/node/v10.16.2/lib/node_modules/pm2/bin/pm2 reload all
  17. ExecStop=/www/server/nvm/versions/node/v10.16.2/lib/node_modules/pm2/bin/pm2 kill

  18. [Install]
  19. WantedBy=multi-user.target
复制代码


使用用户为:
  1. User=undefined
复制代码

建议修改:
  1. /www/server/panel/plugin/pm2/pm2_main.py
复制代码


第121行
  1. public.ExecShell(self.__SR + 'pm2 save && pm2 startup');
复制代码

改为
  1. public.ExecShell(self.__SR + 'pm2 cleardump && pm2 save && pm2 startup -u root');
复制代码
第159行
  1. public.ExecShell(self.__SR + 'pm2 save && pm2 startup');
复制代码
改为
  1. public.ExecShell(self.__SR + 'pm2 cleardump && pm2 save && pm2 startup -u root');
复制代码



使用道具 举报 只看该作者 回复
发表于 2019-8-17 11:54:46 | 显示全部楼层
好的 这边会看看具体怎么修改
使用道具 举报 回复 支持 反对
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

企业版年付运维跟进群

普通问题处理

论坛响应时间:72小时

问题处理方式:排队(仅解答)

工作时间:白班:9:00 - 18:00

紧急问题处理

论坛响应时间:10分钟

问题处理方式:1对1处理(优先)

工作时间:白班:9:00 - 18:00

工作时间:晚班:18:00 - 24:00

立即付费处理
快速回复 返回顶部 返回列表