unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* TERM vs QUIT
@ 2009-10-01 23:52 Chris Wanstrath
  2009-10-01 23:56 ` Chris Wanstrath
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wanstrath @ 2009-10-01 23:52 UTC (permalink / raw)
  To: mongrel-unicorn

Hi list,

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?

We're running into a situation where some our daemons respond to the
same signals in different ways and it'd be great if they were
consistent.

Thanks!

-- 
Chris Wanstrath
http://github.com/defunkt

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TERM vs QUIT
  2009-10-01 23:52 TERM vs QUIT Chris Wanstrath
@ 2009-10-01 23:56 ` Chris Wanstrath
  2009-10-02  1:53   ` Eric Wong
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Wanstrath @ 2009-10-01 23:56 UTC (permalink / raw)
  To: mongrel-unicorn

On Thu, Oct 1, 2009 at 4:52 PM, Chris Wanstrath <chris@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!

Thanks,

Chris

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TERM vs QUIT
  2009-10-01 23:56 ` Chris Wanstrath
@ 2009-10-02  1:53   ` Eric Wong
  2009-10-02 18:35     ` Chris Wanstrath
  0 siblings, 1 reply; 4+ messages in thread
From: Eric Wong @ 2009-10-02  1:53 UTC (permalink / raw)
  To: Chris Wanstrath; +Cc: mongrel-unicorn

Chris Wanstrath <chris@ozmm.org> wrote:
> On Thu, Oct 1, 2009 at 4:52 PM, Chris Wanstrath <chris@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
both.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: TERM vs QUIT
  2009-10-02  1:53   ` Eric Wong
@ 2009-10-02 18:35     ` Chris Wanstrath
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Wanstrath @ 2009-10-02 18:35 UTC (permalink / raw)
  To: Eric Wong; +Cc: mongrel-unicorn

On Thu, Oct 1, 2009 at 6:53 PM, Eric Wong <normalperson@yhbt.net> wrote:

> 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
> both.

I think this is a great decision. Saying "Unicorn behaves just like
nginx when sent HUP," for example, is really useful when learning a
new technology.

Thanks for the response!

-- 
Chris Wanstrath
http://github.com/defunkt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-10-02 18:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-01 23:52 TERM vs QUIT Chris Wanstrath
2009-10-01 23:56 ` Chris Wanstrath
2009-10-02  1:53   ` Eric Wong
2009-10-02 18:35     ` Chris Wanstrath

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).