--- /dev/null
+[Unit]
+Description=asinine IP over HTTP server
+Wants=userv.service
+
+[Service]
+# These settings can be overridden in /etc/default/hippotatd
+Environment=DAEMON=/usr/sbin/hippotatd
+Environment=MAIN_CONFIG=/etc/hippotat/main.cfg
+Environment=LOGFACILITY=daemon
+Environment=CHECK_FIREWALL=true
+Environment=HIPPOTATD_ARGS=
+
+EnvironmentFile=-/etc/default/hippotatd
+
+User=_hippotat
+
+# Don't run if unconfigured.
+ExecCondition=egrep -q '^[^ \t#]' ${MAIN_CONFIG}
+
+# Fail if user appears to have overridden USER but not User= (which
+# sets LOGNAME). To change the user that hippotatd runs as, use a
+# drop-in in /etc/systemd/system/hippotatd.service.d to override
+# User=.
+ExecStartPre=test ${USER} = ${LOGNAME}
+
+# Fetch iptables configuration and check if it's reasonable if
+# CHECK_FIREWALL is "true".
+RuntimeDirectory=hippotat
+RuntimeDirectoryMode=0700
+ExecStartPre=:!sh -c 'if "${CHECK_FIREWALL}"; then \
+ iptables -L -v -n > "${RUNTIME_DIRECTORY}"/firewall_rules; fi'
+ExecStartPre=:sh -c 'if "${CHECK_FIREWALL}"; then \
+ vnetwork="$($DAEMON $HIPPOTATD_ARGS --print-config vnetwork)" && \
+ fgrep " $vnetwork " "${RUNTIME_DIRECTORY}"/firewall_rules > /dev/null; fi'
+
+Type=notify
+ExecStart=:sh -c '\
+ if type authbind >/dev/null 2>&1; then AUTHBIND=authbind; fi; \
+ exec $AUTHBIND "$DAEMON" --syslog-facility="$LOGFACILITY" $HIPPOTATD_ARGS'
+
+[Install]
+WantedBy=multi-user.target
override_dh_installinit:
dh_installinit --name=hippotatd
+override_dh_installsystemd:
+ dh_installsystemd --name=hippotatd
# For local testing with upstream dependencies:
# NAILING_CARGO=nailing-cargo make check
The `hippotat-server` package
supplies an init script
+and a systemd unit, either of
which will start the `hippotatd` server program,
if `/etc/hippotat/main.cfg` exists.
If you just created that file,
`service hippotatd start` will start the server..
-Consult the init script to see options you can put in
+Consult the init script or unit file to see options you can put in
`/etc/default/hippotat`.