What signal will upstart/initctl use to restart a job? Furthermore, is there any way to specify that SIGHUP should be used?

Alternately, is there a way to define a custom reload command that will send a SIGHUP? Or do I need to go outside of upstart to do that?

link|improve this question

25% accept rate
I believe it's SIGQUIT; The response to SIGHUP is application specific in most cases. – Chris S Oct 11 '10 at 16:10
That would make sense. See my clarification edits. – David Eyk Oct 11 '10 at 16:14
feedback

1 Answer

up vote 7 down vote accepted

What signal will upstart/initctl use to restart a job?

SIGTERM

strace -fp `pgrep cron` 2> ~/strace &
initctl restart cron

cat ~/strace

rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {0x804a280, [CHLD], SA_RESTART}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({60, 0}, {57, 153662204})     = ? ERESTART_RESTARTBLOCK (To be restarted)
--- SIGTERM (Terminated) @ 0 (0) ---
Process 2275 detached

Furthermore, is there any way to specify that SIGHUP should be used?

Use: initctl reload

Alternately, is there a way to define a custom reload command that will send a SIGHUP?

Use: initctl reload

Or do I need to go outside of upstart to do that?

Use initctl reload or kill/killall -HUP

link|improve this answer
Very thorough. Thank you. Guess I could have found some of that on the man page! – David Eyk Oct 11 '10 at 16:32
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.