I cannot install pm2 startup on VPS

Avatar
  • Answered
Hey guys.
I am trying to put pm2 manager on initialize folder for a possible reboot.
I tried this both command:
sudo pm2 startup init.d
sudo su -c "env PATH=$PATH:/usr/local/bin pm2 startup init.d -u zipzap8 --hp /home/zipzap8"

I am trying this on root level user and the both command give me this follow error:
[PM2] Writing startup script in /etc/init.d/pm2-init.sh

[PM2] Making script booting at startup...

[PM2] -init.d- Using the command:

su -c "chmod +x /etc/init.d/pm2-init.sh && update-rc.d pm2-init.sh defaults"

Command failed: su -c "chmod +x /etc/init.d/pm2-init.sh && update-rc.d pm2-init.sh defaults"

bash: update-rc.d: command not found
----- Are you sure you use the right platform command line option ? centos / redhat, amazon, ubuntu, gentoo, systemd or darwin?

Can you help me with this issue?
Thank you
Avatar
IMH Support Agent 5
Hello, Thank you for your question about running the update-rc.d command in your VPS. Our servers use Centos by default. The command you are trying to run appears to be used in Debian based servers. You will want to find a command that works in Red Hat based environments like Centos. Some forums suggest using chkconfig instead. Best, Christopher M.