Start app as root with pm2

前端 未结 7 1622
遥遥无期
遥遥无期 2021-01-31 17:29

I have a daemon that must be run as root on startup.

I use pm2 to start other apps but can not figure out if it can start an app as root. Can it be done?

If not,

7条回答
  •  深忆病人
    2021-01-31 17:58

    You should start pm2 as a root, (sudo pm2 start app.js), then your app will start as a root

提交回复
热议问题