Eric Wong normalperson at yhbt.net
Thu Oct 1 21:53:01 EDT 2009

Chris Wanstrath <chris at ozmm.org> wrote:
> On Thu, Oct 1, 2009 at 4:52 PM, Chris Wanstrath <chris at ozmm.org> wrote:
> > According to http://en.wikipedia.org/wiki/SIGTERM, SIGTERM should be
> > used for graceful termination.
> >
> > According to http://www.cons.org/cracauer/sigint.html, SIGQUIT should
> > be used for immediate termination.
> >
> > Is there any reason Unicorn seems to flip these two and use TERM for
> > immediate termination and QUIT for graceful termination?
> Looks like nginx flips them, too, and Unicorn's signal handling is
> based on nginx's.
> We will defer to the Russians and make our stuff consistent with nginx!

Yup, I based the current user interface around the one in nginx to
capitalize on some of my target users' existing familiarity with nginx
and also to (hopefully) lower the barrier of entry for folks new to

Of course I'm not happy with some of the choices nginx made. Using "pid"
instead of "pid_file" in the configuration language really bothers me,
and I completely agree TERM is more logical for graceful shutdowns. But
in the end the nginx UI was "good enough" and consistency won me over.

So things like the init script in examples/init.sh can be adapted to
work for both unicorn and nginx without changing anything other than
path names and some (hopefully few) command-line arguments.

Making user interface choices for for other people isn't something I'm
comfortable with, so I just try to take advantage of what people
already know/expect as much as possible.  I'm lazy in that way :)

For a few weeks (or months now?) I've been debating/avoiding the
"--kill" switch item I have in the TODO (it was requested by a user in
Real-Life(TM)).  I'm still not sure where/how/if it would fit, and
maybe it just doesn't fit.  /me goes on to ponder it a bit more ...

Eric Wong

More information about the mongrel-unicorn mailing list