- 设置 pm2 开机启动,执行下面的脚本即可
- 参考:
a. http://cnodejs.org/topic/556f02a98ce3684b284b55ad
a. https://www.zhihu.com/question/40099216/answer/84720423
#!/bin/bash
pm2 start /data/www/mobi/mobi_pm2.json && \
pm2 save && \
pm2 startup
# then it has a file in /etc/init.d/pm2-root
# [root@dbquan-pc ~]# chkconfig | grep pm2
# pm2-root 0:off 1:off 2:on 3:on 4:on 5:on 6:off
#
# ok, nexttime reboot will auto restart pm2
# [PM2] Freeze a process list on reboot via:
# $ pm2 save
#
# [PM2] Remove init script via:
# $ pm2 unstartup systemv
网友评论