Solved: PM2 Startup at boot time Centos 7 / Red Hat Linux

As of the latest version of pm2 there is a slight bug in the process that writes the startup script to your /etc/init.d directory.  Out of the box the on reboot (or by executing the script as root) you will see the following error:

The fix is simple.  By fixing one line of code in the shell script your pm2 will now startup correctly.

Note the export PM2_HOME line is incorrect.  The PM2_HOME should actually point to the home directory of the USER you told pm2 to run under.  So change that line to the following:

Note that myPm2User should be replaced with whatever user account you want to run pm2 under.

Now when you reboot you will see success:

 

 

 

1 comment

Leave a Reply

Your email address will not be published. Required fields are marked *