Last active
October 13, 2016 09:02
-
-
Save my-janala/d595c1bbeef45f4febfcf20598c8465a to your computer and use it in GitHub Desktop.
Creating auto-startup script using pm2.
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
$ pm2 startup ubuntu | |
[PM2] You have to run this command as root. Execute the following command: | |
sudo su -c "env PATH=$PATH:/opt/node-v4.3.1-linux-x64/bin pm2 startup ubuntu -u jenkins --hp /home/jenkins" | |
Now run the command as root as it says here http://pm2.keymetrics.io/docs/usage/startup/. | |
Then run | |
$ pm2 save | |
as the user running the node service. In my case, it's jenkins. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment