-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pm2 startup error on Centos 6.3 #57
Comments
According to this stackoverflow post I think that the OS checking part is a bit fastidious and checking the update-rc.d script just take 1 line of code so I'd vote for the second way of doing this :). |
I get the same error. |
Is there an update-rc.d tool like in CentOS ? |
Looks like chkconfig might be the centos version http://linuxcommand.org/man_pages/chkconfig8.html |
I want this too, please! |
On CentOS 6.4 i had to add some config at the begining of the file...
It's means booting at levels 2,3,4 and 5 and the other two numbers (98 02) are the priorities at boot and shutdown time i think
|
I think it's okay now, someone can tell me if it works on CentOS ? To try the startup script :
Thanks for feedback |
Is that what you expected? |
Yes, can you try now the command
|
I have a Linux AMI based on Redhat. Would you be able to get this script working for Redhat too? |
@ecoad give me more clues about how to start a process at startup on Redhat with V init scripts, thanks |
@Unitech I got the Empty error , please have a look. My server is Thanks! |
@mani95lisa |
I have the same problem as @mani95lisa. Gives no feedback, does create the init script, but nothing starts on startup |
Can you copy paste the output of |
https://gist.github.com/howtoinstallghost/8367225 also has the error from the pm2 error log Thanks, |
I have to use forever to make it right, hope this problem could be resolved. |
At least pm2 has generated the init script. Here is the line doing the chkconfig : https://github.com/Unitech/pm2/blob/master/lib/CLI.js#L204 If someone know the right command line to set a script at startup on CentOS, please share (: |
This worked for me on CentOS6.4
Just replace these values by what is written on the /etc/init.d/pm2-init.sh (node and pm2) Tell me if it worked for you also |
@Unitech Your suggestion above works for me. I wanted to avoid using the cron to resurrect so I looked into why the init.d script wasnt working for me. I am running on the Amazon Linux AMI and the default init.d script was not starting my application. In the init.d script I removed the super function and all the calls to it and it started working for me. Not sure if this is a bug with the init.d script but it worked for me. |
I've written a dedicated startup script for centos : https://github.com/Unitech/pm2/blob/master/lib/scripts/pm2-init-centos.sh It uses su instead of sudo and creates the lockfile to call the init script on shutdown. Available on pm2 0.7.2
|
I was able to run the startup command on an Oracle Linux machine, might have been Red Hat, even though I tried using redhat as a platform option. This worked beautifully, my pm2 processes restart when the server restarts. |
👍 |
When running pm2 startup the following error is generated
pm2 startup
{ [Error: Command failed: /bin/sh: update-rc.d: command not found
] killed: false, code: 127, signal: null }
I guess there are 2 possible solutions
Any thoughts on the best way to solve this?
The text was updated successfully, but these errors were encountered: