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

Startup script does not initialize on Debian Dreamhost VPS #296

Closed
joesepi opened this issue Feb 8, 2014 · 5 comments
Closed

Startup script does not initialize on Debian Dreamhost VPS #296

joesepi opened this issue Feb 8, 2014 · 5 comments

Comments

@joesepi
Copy link

joesepi commented Feb 8, 2014

Here is my initial output:

[ps]$ pm2 startup ubuntu
PM2 You have to run this command as root
PM2 Execute the following command :
PM2 sudo env PATH=$PATH:/home/so-loser/.nvm/v0.10.22/bin pm2 startup ubuntu -u so-loser
[ps]$ sudo env PATH=$PATH:/home/so-loser/.nvm/v0.10.22/bin pm2 startup ubuntu -u so-loser
[sudo] password for so-loser:
PM2 Generating system V init script in /etc/init.d/pm2-init.sh
PM2 Making script booting at startup...
PM2 -ubuntu- Using the command chmod +x /etc/init.d/pm2-init.sh; update-rc.d pm2-init.sh defaults
{ [Error: Command failed: /bin/sh: update-rc.d: command not found
] killed: false, code: 127, signal: null }
----- Are you sure you use the right platform command line option ? centos / redhat or ubuntu ?

So I then added /usr/sbin to my path based on some google searching and that got me to this:

PM2 -ubuntu- Using the command chmod +x /etc/init.d/pm2-init.sh; update-rc.d pm2-init.sh defaults
{ [Error: Command failed: Can't exec "insserv": No such file or directory at /usr/sbin/update-rc.d line 417.
update-rc.d: error: insserv rejected the script header
] killed: false, code: 255, signal: null }
----- Are you sure you use the right platform command line option ? centos / redhat or ubuntu ?

I feel like I have just entered a rabbit hole.

I am not sure if this is an error with Debian, PM2, Dreamhost or what. If anyone has any suggestions, I am all ears.

@ReyVolver
Copy link

After looking into update-rc.d, line ~417 is:

my $rc = system("insserv", @opts, $scriptname) >> 8;
if (0 == $rc && !$notreally) {
    save_last_action($scriptname, @orig_argv);
}
error_code($rc, "insserv rejected the script header") if $rc;
exit $rc;

Try to symlink insserv with ln -s /usr/lib/insserv/insserv /sbin/insserv or wherever is insserv
FWI,

simpleuser$ insserv
simpleuser$ insserv: command not found

but sudo insserv works fine.

@joesepi
Copy link
Author

joesepi commented Feb 9, 2014

I have symlinked the shit out of insserv, everywhere, and I still cannot get this to run. I have added a ton of stuff to my PATH as well. Still same error as before.

@ReyVolver
Copy link

Does sudo insserv returns command not found ?

Maybe you should try to do it manually:

$ cd /tmp
$ wget https://raw.github.com/Unitech/pm2/master/lib/scripts/pm2-init.sh
$ mv pm2-init.sh /etc/init.d/pm2-init.sh
$ chmod +x /etc/init.d/pm2-init.sh
$ update-rc.d pm2-init.sh defaults

@soyuka
Copy link
Collaborator

soyuka commented Feb 24, 2014

#289 related

@soyuka
Copy link
Collaborator

soyuka commented Jul 4, 2014

#548 should resolve this, let me know if it doesn't

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants