unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / Atom feed
* [PATCH] doc: systemd should only kill master in example
@ 2016-06-13 22:31 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2016-06-13 22:31 UTC (permalink / raw)
  To: unicorn-public

By default, systemd kills every process in the control group
when stopping a service.  While it ought to be harmless to
signal workers, some Rack applications (and perhaps further
subprocesses) can misbehave when interrupted by a signal.
Ensure we only hit the master on graceful shutdown to avoid
tickling bugs in Rack apps.

This is the reason we switched to having the master send
"fake" signals for workers beginning with unicorn 4.8.0
back in 2013/2014.
 examples/unicorn@.service | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/examples/unicorn@.service b/examples/unicorn@.service
index 56aaec8..d95eb83 100644
--- a/examples/unicorn@.service
+++ b/examples/unicorn@.service
@@ -24,5 +24,10 @@ ExecReload = /bin/kill -HUP $MAINPID
 # adding a few seconds for scheduling differences:
 TimeoutStopSec = 62
+# Only kill the master process, it may be harmful to signal
+# workers via default "control-group" setting since some
+# Ruby extensions and applications misbehave on interrupts
+KillMode = process
 WantedBy = multi-user.target

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-13 22:31 [PATCH] doc: systemd should only kill master in example Eric Wong

unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help

Archives are clonable:
	git clone --mirror https://bogomips.org/unicorn-public
	git clone --mirror http://ou63pmih66umazou.onion/unicorn-public

Example config snippet for mirrors

Newsgroups are available over NNTP:

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox