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

signals not getting passed through #10

Open
matthewmueller opened this issue Jan 23, 2013 · 7 comments
Open

signals not getting passed through #10

matthewmueller opened this issue Jan 23, 2013 · 7 comments

Comments

@matthewmueller
Copy link
Contributor

have some cleanup work to do on my process (a server), but when I issue a kill -s SIGQUIT $pid it will kill the process, but it doesn't run the cleanup.

I've noticed this will work fine with mon.

@matthewmueller
Copy link
Contributor Author

actually, i think this has to do with the pid in say, pids/web.pid, being tied to sh -c node app.js 9000 (sh -c $command) instead of just node app.js 9000 ($command).

for context, here's what i'm seeing with ps aux | grep "node":

1000      7612  0.0  0.0   2156   276 ?        Ss   02:05   0:00 mon -d node app.js 9000 -p pids/web.pid
1000      7687  0.0  0.1   2236   544 ?        S    02:05   0:00 sh -c node app.js 9000
1000      7688  6.8  3.6  62752 18416 ?        Sl   02:05   0:00 node app.js 9000

pids/web.pid outputs 7687, and when i run kill -s SIGQUIT $(cat pids/web.pid) it will not run the signal cleanup code.

UPDATE: also, it seems to be happening only on ubuntu, on my mac, i'm not getting the additional shell process

any thoughts?

@jgallen23
Copy link
Owner

I had the same problem with mon on ubuntu. I'm using this forked version of mon and it seems to be working on ubuntu: https://github.com/jgallen23/mon

@matthewmueller
Copy link
Contributor Author

ah yah, it looks like mon is creating the extra process:

I just ran:

mon -d NODE_PATH=lib NODE_ENV=production node app.js 8000

and then ps aux | grep "node":

1000     25744  0.0  0.0   2156    68 ?        Ss   15:59   0:00 mon -d NODE_PATH=lib NODE_ENV=production node app.js 8000
1000     25745  0.0  0.1   2236   540 ?        S    15:59   0:00 sh -c NODE_PATH=lib NODE_ENV=production node app.js 8000

any idea what's going on here @visionmedia?

@tj
Copy link
Contributor

tj commented Feb 8, 2013

it was because dash's -c doesn't use exec apparently

@tj
Copy link
Contributor

tj commented Feb 8, 2013

so it's not replacing the process image, moral of the story, dash sucks

@matthewmueller
Copy link
Contributor Author

any fix for this? right now i'm killing the process by incrementing the pid

kill `expr $(cat pids/web.pid) + 1`

this definitely seems dangerous

@jgallen23
Copy link
Owner

try my fork of mon. It should solve the problem

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

No branches or pull requests

3 participants