这是 GitHub 上文档的链接: https://github.com/Unitech/pm2#startup-script-generation--pm2-startup
它被设置为与 Ubuntu/CentOS/Redhat 一起工作。我需要它与我的 Dreamhost VPS 一起工作,这是一台 Debian 机器。
有人可以建议我如何调整初始化脚本以使其在 Debian 机器上运行吗?谢谢!!
最佳答案
如果您的 vps 运行的是 Jessie 版本 (>8),那么 Jessie 使用 systemd 而不是 init.d(就像 ubuntu 和旧版本的 debian 那样)。因此使用默认的 ubuntu pm2 启动脚本是行不通的。
所以如果这是你的情况,那么我所做的就是在我的 Jessie VM 上工作
$ pm2 startup systemd
然后 pm2 启动我想在启动时启动的 Node 应用程序。
然后
$ pm2 save
然后试一试。
$ shutdown -r now
当然是从 root 做这些
关于linux - Debian平台下如何使用pm2启动命令?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21506505/