]> Sergey Matveev's repositories - public-inbox.git/blob - examples/public-inbox-httpd@.service
147f7c6dd9d709a5353dac4cb469086ebc35caad
[public-inbox.git] / examples / public-inbox-httpd@.service
1 # ==> /etc/systemd/system/public-inbox-httpd@.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. public-inbox-httpd@1 public-inbox-httpd@2) with the intention
5 # that they take turns running in-between upgrades.  This should
6 # allow upgrading without downtime.
7 # For servers expecting visitors from multiple timezones, TZ=UTC
8 # is needed to ensure a consistent approxidate experience with search.
9
10 [Unit]
11 Description = public-inbox PSGI server %i
12 Wants = public-inbox-httpd.socket
13 After = public-inbox-httpd.socket
14
15 [Service]
16 Environment = PI_CONFIG=/home/pi/.public-inbox/config \
17 PATH=/usr/local/bin:/usr/bin:/bin \
18 TZ=UTC \
19 PERL_INLINE_DIRECTORY=/tmp/.pub-inline
20
21 LimitNOFILE = 30000
22 ExecStartPre = /bin/mkdir -p -m 1777 /tmp/.pub-inline
23 ExecStart = /usr/local/bin/public-inbox-httpd \
24 -1 /var/log/public-inbox/httpd.out.log
25 StandardError = syslog
26
27 # NonBlocking is REQUIRED to avoid a race condition if running
28 # simultaneous services
29 NonBlocking = true
30 Sockets = public-inbox-httpd.socket
31
32 KillSignal = SIGQUIT
33 User = nobody
34 Group = nogroup
35 ExecReload = /bin/kill -HUP $MAINPID
36 TimeoutStopSec = 86400
37 KillMode = process
38
39 [Install]
40 WantedBy = multi-user.target