about summary refs log tree commit homepage
path: root/examples/public-inbox-httpd@.service
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-06-13 04:53:30 +0000
committerEric Wong <e@80x24.org>2016-06-13 04:56:33 +0000
commit9dc61f9132a7c4ac4a4d067cdd48efb7c28de102 (patch)
tree940986f5bdce17db304ecb57ac24a14b188feb40 /examples/public-inbox-httpd@.service
parentb6e2d71cd342a55e942915a082ca3fd15812e48d (diff)
downloadpublic-inbox-9dc61f9132a7c4ac4a4d067cdd48efb7c28de102.tar.gz
Since our daemons are built to take advantage of socket activation,
provide example files to allow systems administrators to hit the
ground running with systemd.

Example init files for other systems greatly appreciated.
Diffstat (limited to 'examples/public-inbox-httpd@.service')
-rw-r--r--examples/public-inbox-httpd@.service29
1 files changed, 29 insertions, 0 deletions
diff --git a/examples/public-inbox-httpd@.service b/examples/public-inbox-httpd@.service
new file mode 100644
index 00000000..3bb70726
--- /dev/null
+++ b/examples/public-inbox-httpd@.service
@@ -0,0 +1,29 @@
+# ==> /etc/systemd/system/public-inbox-httpd@.service <==
+# Since SIGUSR2 upgrades do not work under systemd, this service file
+# allows starting two simultaneous services during upgrade time
+# (e.g. public-inbox-httpd@1 public-inbox-httpd@2) with the intention
+# that they take turns running in-between upgrades.  This should
+# allow upgrading without downtime.
+
+[Unit]
+Description = public-inbox PSGI server %i
+Wants = public-inbox-httpd.socket
+After = public-inbox-httpd.socket
+
+[Service]
+Environment = PI_CONFIG=/home/pi/.public-inbox/config \
+PATH=/usr/local/bin:/usr/bin:/bin \
+PERL_INLINE_DIRECTORY=/tmp/.pub-inline
+
+LimitNOFILE = 30000
+ExecStartPre = /bin/mkdir -p -m 1777 /tmp/.pub-inline
+ExecStart = /usr/local/bin/public-inbox-httpd
+Sockets = public-inbox-httpd.socket
+KillSignal = SIGQUIT
+User = nobody
+Group = nogroup
+ExecReload = /bin/kill -HUP $MAINPID
+TimeoutStopSec = 3600
+
+[Install]
+WantedBy = multi-user.target