ralyodio / node-startup

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

`is_running` detection implementation #40

Closed thetrompf closed 7 years ago

thetrompf commented 7 years ago

Wouldn't it better to leverage the /proc filesystem to figure out if the process is running instead of "parsing" ps output with awk and grep?

is_running() {
    [ -d "/proc/$(get_pid)" ] 
}
ralyodio commented 7 years ago

Good idea. Can you submit a PR?

thetrompf commented 7 years ago

Yes I can, I'll to it tonight