This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I ran into this issue, and found a solution that works for me. Let's assume I've created a user named 'node' to run pm2. All of the commands below should be run by the node user, in the node user's home directory (/home/node) | |
Clear any pm2 dump files, and then start the appropriate services | |
% pm2 delete all | |
% pm2 dump | |
% pm2 start app.js --watch | |
Save the current config to start on reboot | |
% pm2 save | |
% sudo pm2 startup centos -u node | |
Edit the PM2_HOME path in the pm2-init script to match the home directory of the user: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
██╗██████╗ ██╗ ██████╗ ██╗ ██████╗ | |
██║██╔══██╗███║██╔═████╗███║██╔════╝ | |
██║██████╔╝╚██║██║██╔██║╚██║███████╗ | |
██ ██║██╔═══╝ ██║████╔╝██║ ██║██╔═══██╗ | |
╚█████╔╝██║ ██║╚██████╔╝ ██║╚██████╔╝ | |
╚════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝ | |