]> Sergey Matveev's repositories - public-inbox.git/blob - examples/public-inbox-httpd@.service
treewide: replace /^I: / prefix with /^# /
[public-inbox.git] / examples / public-inbox-httpd@.service
1 # ==> /etc/systemd/system/public-inbox-httpd@.service <==
2 # Consider looking at public-inbox-netd@.service instead of this file
3 # to simplify management when serving multiple protocols.
4 #
5 # Since SIGUSR2 upgrades do not work under systemd, this service file
6 # allows starting two simultaneous services during upgrade time
7 # (e.g. public-inbox-httpd@1 public-inbox-httpd@2) with the intention
8 # that they take turns running in-between upgrades.  This should
9 # allow upgrading without downtime.
10 # For servers expecting visitors from multiple timezones, TZ=UTC
11 # is needed to ensure a consistent approxidate experience with search.
12
13 [Unit]
14 Description = public-inbox PSGI server %i
15 Wants = public-inbox-httpd.socket
16 After = public-inbox-httpd.socket
17
18 [Service]
19 Environment = PI_CONFIG=/home/pi/.public-inbox/config \
20 PATH=/usr/local/bin:/usr/bin:/bin \
21 TZ=UTC \
22 PERL_INLINE_DIRECTORY=/tmp/.pub-inline
23
24 LimitNOFILE = 30000
25 ExecStartPre = /bin/mkdir -p -m 1777 /tmp/.pub-inline
26 ExecStart = /usr/local/bin/public-inbox-httpd \
27 -1 /var/log/public-inbox/httpd.out.log
28 StandardError = syslog
29
30 # NonBlocking is REQUIRED to avoid a race condition if running
31 # simultaneous services
32 NonBlocking = true
33 Sockets = public-inbox-httpd.socket
34
35 KillSignal = SIGQUIT
36 User = nobody
37 Group = nogroup
38 ExecReload = /bin/kill -HUP $MAINPID
39 TimeoutStopSec = 86400
40 KillMode = process
41
42 [Install]
43 WantedBy = multi-user.target