]> Sergey Matveev's repositories - public-inbox.git/blob - examples/public-inbox-netd@.service
lei_mirror: simplify clone_v2_prep
[public-inbox.git] / examples / public-inbox-netd@.service
1 # ==> /etc/systemd/system/public-inbox-netd@.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-netd@1 public-inbox-netd@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 [Unit]
10 Description = public-inbox-netd server %i
11 Wants = public-inbox-netd.socket
12 After = public-inbox-netd.socket
13
14 [Service]
15 Environment = PI_CONFIG=/home/pi/.public-inbox/config \
16 PATH=/usr/local/bin:/usr/bin:/bin \
17 TZ=UTC \
18 PERL_INLINE_DIRECTORY=/tmp/.netd-inline
19
20 LimitNOFILE = 30000
21 LimitCORE = infinity
22 ExecStartPre = /bin/mkdir -p -m 1777 /tmp/.netd-inline
23
24 # The '-l' args below map each socket in public-inbox-netd.socket to
25 # the appropriate IANA service name:
26 ExecStart = /usr/local/bin/public-inbox-netd -W0 \
27 -1 /var/log/netd/stdout.out.log \
28 --cert /etc/ssl/certs/news.example.com.pem \
29 --key /etc/ssl/private/news.example.com.key
30 -l imap:///run/imap.sock?out=/var/log/netd/imap.out,err=/var/log/netd/imap.err \
31 -l nntp:///run/nntp.sock?out=/var/log/netd/nntp.out,err=/var/log/netd/nntp.err \
32 -l pop3:///run/pop3.sock?out=/var/log/netd/pop3.out,err=/var/log/netd/pop3.err \
33 -l imap://0.0.0.0/?out=/var/log/netd/imap.out,err=/var/log/netd/imap.err \
34 -l nntp://0.0.0.0/?out=/var/log/netd/nntp.out,err=/var/log/netd/nntp.err \
35 -l pop3://0.0.0.0/?out=/var/log/netd/pop3.out,err=/var/log/netd/pop3.err \
36 -l imap://[::]/?out=/var/log/netd/imap.out,err=/var/log/netd/imap.err \
37 -l nntp://[::]/?out=/var/log/netd/nntp.out,err=/var/log/netd/nntp.err \
38 -l pop3://[::]/?out=/var/log/netd/pop3.out,err=/var/log/netd/pop3.err \
39 -l imaps://0.0.0.0/?out=/var/log/netd/imap.out,err=/var/log/netd/imap.err \
40 -l nntps://0.0.0.0/?out=/var/log/netd/nntp.out,err=/var/log/netd/nntp.err \
41 -l pop3s://0.0.0.0/?out=/var/log/netd/pop3.out,err=/var/log/netd/pop3.err \
42 -l imaps://[::]/?out=/var/log/netd/imap.out,err=/var/log/netd/imap.err \
43 -l nntps://[::]/?out=/var/log/netd/nntp.out,err=/var/log/netd/nntp.err \
44 -l pop3s://[::]/?out=/var/log/netd/pop3.out,err=/var/log/netd/pop3.err \
45 -l http://127.0.0.1:280/?psgi=/etc/public.psgi,err=/var/log/netd/http.err
46
47 # NonBlocking is REQUIRED to avoid a race condition if running
48 # simultaneous services
49 NonBlocking = true
50
51 Sockets = public-inbox-netd.socket
52 KillSignal = SIGQUIT
53 User = news
54 Group = ssl-cert
55 ExecReload = /bin/kill -HUP $MAINPID
56 TimeoutStopSec = 30
57 KillMode = process
58
59 [Install]
60 WantedBy = multi-user.target