默认情况下,pm2 是否会在重启后自动重启应用程序?

Does pm2 auto restart application after reboot by default?

我的 linux 服务器有问题,需要重新启动,在此之前,我 运行 我的节点应用程序 pm2 start server.js 没有任何其他配置。它可以在重启服务器后自动重启我的应用程序吗?

默认情况下不是,但是 PM2 可以使用 startup script:

PM2 can generate startup scripts and configure them in order to keep your process list intact across expected or unexpected machine restarts.

生成启动脚本后(另请阅读此 comment),查看 pm2 save:

Once you started all the applications you want to manage, you have to save the list you wanna respawn at machine reboot with:

pm2 save