Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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
add comment

1 Answer

up vote 9 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

share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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