Merge remote-tracking branch 'origin/jr/init'
[unicorn.git] / examples / unicorn@.service
blobd95eb83c91ebe64ee07684186fadeea44501dcfd
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
17 Sockets = unicorn.socket
18 KillSignal = SIGQUIT
19 User = nobody
20 Group = nogroup
21 ExecReload = /bin/kill -HUP $MAINPID
23 # This is based on the Unicorn::Configurator#timeout directive,
24 # adding a few seconds for scheduling differences:
25 TimeoutStopSec = 62
27 # Only kill the master process, it may be harmful to signal
28 # workers via default "control-group" setting since some
29 # Ruby extensions and applications misbehave on interrupts
30 KillMode = process
32 [Install]
33 WantedBy = multi-user.target