aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-misc/iipsrv/files/iipsrv.systemd.service')
-rw-r--r--net-misc/iipsrv/files/iipsrv.systemd.service21
1 files changed, 21 insertions, 0 deletions
diff --git a/net-misc/iipsrv/files/iipsrv.systemd.service b/net-misc/iipsrv/files/iipsrv.systemd.service
new file mode 100644
index 000000000..7641b0ef6
--- /dev/null
+++ b/net-misc/iipsrv/files/iipsrv.systemd.service
@@ -0,0 +1,21 @@
+[Install]
+WantedBy=multi-user.target
+
+[Unit]
+Description=IIPImage server
+After=network.target
+Documentation=https://iipimage.sourceforge.io man:iipsrv(8)
+
+[Service]
+User=iipsrv
+Group=iipsrv
+
+Environment="HOST=0.0.0.0" "PORT=9000" "LOGFILE=/var/log/iipsrv.log"
+EnvironmentFile=-/etc/default/iipsrv
+
+# Make sure logfile is writable by our user
+ExecStartPre=+/bin/sh -ec "if [[ ${LOGFILE} != syslog ]]; then /usr/bin/touch -a ${LOGFILE} && chown iipsrv:iipsrv ${LOGFILE}; fi"
+
+ExecStart=/usr/sbin/iipsrv --bind ${HOST}:${PORT}
+ExecReload=kill -HUP $MAINPID
+Restart=on-failure