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.

I am starting to convert all of our systems to using upstart to manage our various application processes. One thing that I am constantly missing is the ability to send a different signal to the process on stop or restart events.

For instance, we run our web processes with Unicorn. Unicorn has a great signal handling API. When I want to gracefully reload the process I send the master pid a USR2 signal. To shut them down gracefully I send a QUIT command. TERM (upstart's default stop signal) constitutes an immediate shutdown.

Another example is using Resque. To gracefully shut down a worker I send it the QUIT signal. The TERM signal again causes immediate shutdown, whether the worker's child is forked or not.

Does upstart support custom signals? I can't seem to find it anywhere, which worries me that I'm using the "wrong tool for the job".

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Ubuntu 10.04 comes with upstart version 0.6.6 which has the kill signal and kill timeout parameters which would configure relevant signal and timeout values. The "reload" signal is hardcoded to SIGHUP.

Newer versions of upstart introduce the reload signal parameter - see other answers to this question for further detail.

share|improve this answer
    
Good to know, not sure why the reload signal is hardcoded but I guess I'll have to live with it for the time being. –  localshred Feb 22 '12 at 2:42
    
According to diclophis' answer below, this is now possible via reload signal SIGUSR2, but requires upstart v 1.10.0. –  ghayes Jul 4 at 6:34

As of upstart v1.10.0 you can define a "reload signal".

https://launchpad.net/upstart/1.x/1.10.0

This version is available on ubuntu as of v13.10 ... I used these instructions to upgrade my ec2 instance:

http://askubuntu.com/questions/302762/upgrading-13-04-to-13-10

I use rails+puma and do graceful reloads with this directive in my /etc/init/app-1.conf file:

reload signal SIGUSR2
share|improve this answer

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.