about summary refs log tree commit homepage
path: root/examples/public-inbox-imapd@.service
diff options
context:
space:
mode:
Diffstat (limited to 'examples/public-inbox-imapd@.service')
-rw-r--r--examples/public-inbox-imapd@.service44
1 files changed, 44 insertions, 0 deletions
diff --git a/examples/public-inbox-imapd@.service b/examples/public-inbox-imapd@.service
new file mode 100644
index 00000000..1aede65d
--- /dev/null
+++ b/examples/public-inbox-imapd@.service
@@ -0,0 +1,44 @@
+# ==> /etc/systemd/system/public-inbox-imapd@.service <==
+# Consider looking at public-inbox-netd@.service instead of this file
+# to simplify management when serving multiple protocols.
+#
+# Since SIGUSR2 upgrades do not work under systemd, this service file
+# allows starting two simultaneous services during upgrade time
+# (e.g. public-inbox-imapd@1 public-inbox-imapd@2) with the intention
+# that they take turns running in-between upgrades.  This should
+# allow upgrading without downtime.
+
+[Unit]
+Description = public-inbox-imapd IMAP server %i
+Wants = public-inbox-imapd.socket
+After = public-inbox-imapd.socket
+
+[Service]
+Environment = PI_CONFIG=/home/pi/.public-inbox/config \
+PATH=/usr/local/bin:/usr/bin:/bin \
+TZ=UTC \
+MALLOC_MMAP_THRESHOLD_=131072 \
+PERL_INLINE_DIRECTORY=/tmp/.pub-inline
+
+LimitNOFILE = 30000
+ExecStartPre = /bin/mkdir -p -m 1777 /tmp/.pub-inline
+ExecStart = /usr/local/bin/public-inbox-imapd -W0 \
+-1 /var/log/public-inbox/imapd.out.log \
+--cert /etc/ssl/certs/news.example.com.pem \
+--key /etc/ssl/private/news.example.com.key
+
+# NonBlocking is REQUIRED to avoid a race condition if running
+# simultaneous services
+NonBlocking = true
+
+Sockets = public-inbox-imapd.socket
+
+KillSignal = SIGQUIT
+User = news
+Group = ssl-cert
+ExecReload = /bin/kill -HUP $MAINPID
+TimeoutStopSec = 86400
+KillMode = process
+
+[Install]
+WantedBy = multi-user.target