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
9 Description = unicorn Rack application server %i
10 Wants = unicorn.socket
11 After = unicorn.socket
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:
23 Sockets = unicorn.socket
28 ExecReload = /bin/kill -HUP $MAINPID
30 # This is based on the Unicorn::Configurator#timeout directive,
31 # adding a few seconds for scheduling differences:
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
40 WantedBy = multi-user.target