unicorn.git  about / heads / tags
Rack HTTP server for Unix and fast clients
blob d95eb83c91ebe64ee07684186fadeea44501dcfd 1139 bytes (raw)
$ git show v5.2.0:examples/unicorn@.service	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
# ==> /etc/systemd/system/unicorn@.service <==
# Since SIGUSR2 upgrades do not work under systemd, this service file
# allows starting two simultaneous services during upgrade time
# (e.g. unicorn@1 unicorn@2) with the intention that they take
# turns running in-between upgrades.  This should allow upgrading
# without downtime.

[Unit]
Description = unicorn Rack application server %i
Wants = unicorn.socket
After = unicorn.socket

[Service]
# bundler users must use the "--keep-file-descriptors" switch, here:
# ExecStart = bundle exec --keep-file-descriptors unicorn -c ...
ExecStart = /usr/bin/unicorn -c /path/to/unicorn.conf.rb /path/to/config.ru
Sockets = unicorn.socket
KillSignal = SIGQUIT
User = nobody
Group = nogroup
ExecReload = /bin/kill -HUP $MAINPID

# This is based on the Unicorn::Configurator#timeout directive,
# 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

[Install]
WantedBy = multi-user.target

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