Skip to content
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 fails on rhel 5.10, but easy fix included #524

Closed
cm325 opened this issue Jun 17, 2014 · 5 comments
Closed

pm2 startup fails on rhel 5.10, but easy fix included #524

cm325 opened this issue Jun 17, 2014 · 5 comments
Labels

Comments

@cm325
Copy link

cm325 commented Jun 17, 2014

running pm2 startup centos -u nodeuser gives:

PM2 Generating system init script in /etc/init.d/pm2-init.sh
PM2 Making script booting at startup...
PM2 -centos- Using the command chmod +x /etc/init.d/pm2-init.sh; chkconfig --add pm2-init.sh
/var/lock/subsys/pm2-init.sh lockfile has been added
{ [Error: Command failed: /bin/sh: chkconfig: command not found
] killed: false, code: 127, signal: null }
----- Are you sure you use the right platform command line option ? centos / redhat, amazon, ubuntu or systemd?

this fails because chkconfig lives in /sbin/ which isn't on the PATH by default. Adding it temporarily to the terminal session:

export PATH="$PATH:/sbin"

lets the script succeed. Don't think the script should be changed, but maybe a better message about chkconfig-

@soyuka
Copy link
Collaborator

soyuka commented Jun 17, 2014

Nice, should we specified that in the command i.e use /sbin/chkconfig instead of chkconfig or just specify it in the docs?

https://github.com/Unitech/pm2/blob/master/lib/CLI.js#L314

@soyuka soyuka added bug and removed bug labels Jun 18, 2014
@cm325
Copy link
Author

cm325 commented Jun 18, 2014

It looks like /sbin is added by default on newer versions of rhel, but afaik, it wouldn't hurt to specify the full path, unless chkconfig is ever located somewhere else?

@rlidwka
Copy link
Collaborator

rlidwka commented Jun 22, 2014

/sbin should be always added to root's $PATH, but it might not be present in user's one.

Try "sudo -i pm2 startup centos", note that "-i" flag is important here.

it wouldn't hurt to specify the full path, unless chkconfig is ever located somewhere else

Full path is a bad idea for sure, but I suppose pm2 could modify $PATH temporarily.

@soyuka
Copy link
Collaborator

soyuka commented Jun 22, 2014

Full path is a bad idea for sure, but I suppose pm2 could modify $PATH temporarily.

+1

@soyuka
Copy link
Collaborator

soyuka commented Jul 16, 2014

Assuming this is fixed, please get back to us if it is not.

@soyuka soyuka closed this as completed Jul 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants