t/lib.perl: fix Perl integration tests w/o installation
[unicorn.git] / examples / unicorn@.service
blob946de443ef360030cdd56626c3ca3b8aceda7cd3
1 # ==> /etc/systemd/system/unicorn@.service <==
2 # Since SIGUSR2 upgrades do not work under systemd, this service file
3 # allows starting two simultaneous services during upgrade time
4 # (e.g. unicorn@1 unicorn@2) with the intention that they take
5 # turns running in-between upgrades.  This should allow upgrading
6 # without downtime.
8 [Unit]
9 Description = unicorn Rack application server %i
10 Wants = unicorn.socket
11 After = unicorn.socket
13 [Service]
14 # bundler users must use the "--keep-file-descriptors" switch, here:
15 # ExecStart = bundle exec --keep-file-descriptors unicorn -c ...
16 ExecStart = /usr/bin/unicorn -c /path/to/unicorn.conf.rb /path/to/config.ru
18 # NonBlocking MUST be true if using socket activation with unicorn.
19 # Otherwise, there's a small window in-between when the non-blocking
20 # flag is set by us and our accept4 call where systemd can momentarily
21 # make the socket blocking, causing us to block on accept4:
22 NonBlocking = true
23 Sockets = unicorn.socket
25 KillSignal = SIGQUIT
26 User = nobody
27 Group = nogroup
28 ExecReload = /bin/kill -HUP $MAINPID
30 # This is based on the Unicorn::Configurator#timeout directive,
31 # adding a few seconds for scheduling differences:
32 TimeoutStopSec = 62
34 # Only kill the master process, it may be harmful to signal
35 # workers via default "control-group" setting since some
36 # Ruby extensions and applications misbehave on interrupts
37 KillMode = process
39 [Install]
40 WantedBy = multi-user.target