I am trying to configure PM2 to demonstrate a simple node.js server on centos. The init.d script is executed and there are no errors, but the pm2 list returns an empty list and the server does not start.
I initially tried to start the process as a different user (for those interested, this can be done with changes to pm2-init.sh ). But because of the complexity, I decided to first try to run it as root.
A strange symptom of the problem is that the dump.pm2 file is dump.pm2 emptied by some process, so the resurrection of pm2 has nothing to do. I set pm2 to start on reboot as follows
$ pm2 startup centos $ pm2 start /path/to/my/server.js $ pm2 save
At this point, dump.pm2 had a large JSON object and the server was running. Then do:
$ reboot ... wait and log back in $ pm2 list
It was empty again, as well as a .pm2 dump!
I am not sure which process is cleaning this file. I tried reinstalling and restarting the script launch to no avail. Any help is appreciated.
source share