On ubuntu 14.04 pm2 startup ubuntu should use upstart on ubuntu 14.04 to setup startup script
pm2 startup ubuntu uses systemd for startup script generation on ubuntu 14.04
At the end it says
/bin/sh: 1: systemctl: not found
[error] exit code: 127
[pm2][error] systemctl enable pm2 failed, see error above.
and after that when I restarted the system it didn't boot up, I had to manually fix startup scripts.
my solution was to manually run
pm2 unstartup
pm2 startup upstart
OS : Ubuntu 14.04
node.js : 6.9.x
PM2 : latest
Have you run the command pm2 startup or pm2 startup ubuntu?
How could it detect systemctl automatically if it's not present on the system? https://github.com/Unitech/pm2/blob/master/lib/API/Startup.js#L48
Correct, I checked the command history and it was definitely pm2 startup ubuntu, I'll update the issue description
Because the new LTS version of ubuntu is 16.04 so by default, ubuntu is referring to the version 16.04.
See code source here, you will understand that you should use either pm2 startup or pm2 startup ubuntu14 or pm2 startup upstart
We added a check in pm2 v2.3 (will be released next week) with message to say that you didn't specify the right init-system.
Thanks, it should be on docs page though.
Thanks, was looking for that repo, I think It'd be convenient if docs listed all available platforms
Most helpful comment
Because the new LTS version of ubuntu is
16.04so by default, ubuntu is referring to the version16.04.See code source here, you will understand that you should use either
pm2 startuporpm2 startup ubuntu14orpm2 startup upstartWe added a check in pm2 v2.3 (will be released next week) with message to say that you didn't specify the right init-system.