Skip to content

Instantly share code, notes, and snippets.

View JP1016's full-sized avatar

Jithin Pariyarath JP1016

  • Kerala, India
View GitHub Profile
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:
@JP1016
JP1016 / Hello
Last active October 3, 2019 07:19
hello
██╗██████╗ ██╗ ██████╗ ██╗ ██████╗
██║██╔══██╗███║██╔═████╗███║██╔════╝
██║██████╔╝╚██║██║██╔██║╚██║███████╗
██ ██║██╔═══╝ ██║████╔╝██║ ██║██╔═══██╗
╚█████╔╝██║ ██║╚██████╔╝ ██║╚██████╔╝
╚════╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═════╝