ralyodio / node-startup

Startup script for Linux-based systems for running node app when rebooting using an /etc/init.d script.
MIT License
779 stars 169 forks source link

Node app stopped, but pid file exists #17

Closed subburaj45 closed 10 years ago

subburaj45 commented 10 years ago

Whenever i use /etc/init.d/api start it always throws error

Node app stopped, but pid file exists

anthonyettinger commented 10 years ago

Try the --force flag, you can also change this flag to true in the script: FORCE_OP=true

jhoff commented 10 years ago

I'm getting this as well, every time at boot. The node process thats supposed to start doesn't actually start.

If I force it to stop, I can then start and stop it regularly and it works as expected.

marcoamorales commented 10 years ago

This probably has to do with how the init script does ps ef to look for the pid. If this was changed to a ps aux for example, it should be able to find the pid. Try changing it locally.

I'm talking about this line: https://github.com/chovy/node-startup/blob/dd83e2ad821bdd2182411b91b264cc7d6bbcbab7/init.d/node-app#L45 I don't see why it shouldn't be ps aux by default, maybe I'll submit a PR.