Start app as root with pm2

前端 未结 7 1650
遥遥无期
遥遥无期 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:59

    First, install pm2 globally. Then set root permissions to pm2 using this command

    sudo chown ubuntu:ubuntu /home/ubuntu/.pm2/rpc.sock /home/ubuntu/.pm2/pub.sock
    

提交回复
热议问题