diff --git a/TODO b/TODO index 1811744249098fb51da6af85c7bc6069cf72a93b..7175992c055cb705f004bf208342708c1adc66ed 100644 --- a/TODO +++ b/TODO @@ -3,5 +3,4 @@ Albireo cleanup: - prerouting rule -- shc@.service - containers diff --git a/debian/kam-shipcat.postinst b/debian/kam-shipcat.postinst new file mode 100644 index 0000000000000000000000000000000000000000..626bb53d3b94dd467b1cbb2e0b67fe5c9914bafa --- /dev/null +++ b/debian/kam-shipcat.postinst @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +# systemd reload is usually added automatically by dh_installsystemd, but our +# package provides only a template unit, which is not detected by DH. Let us do +# it manually. +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then + if [ -d /run/systemd/system ]; then + systemctl --system daemon-reload >/dev/null || true + fi +fi diff --git a/debian/kam-shipcat.shc@.service b/debian/kam-shipcat.shc@.service new file mode 100644 index 0000000000000000000000000000000000000000..decd960e32d94dcc66c6a91bebca8b986efd4db4 --- /dev/null +++ b/debian/kam-shipcat.shc@.service @@ -0,0 +1,20 @@ +[Unit] +Description=Container %i (via shipcat) +Wants=network-online.target +After=network-online.target +RequiresMountsFor=/run/containers/storage + +[Service] +Type=forking +TimeoutStopSec=60 +PIDFile=%t/shc/%i.pid + +ExecStartPre=/bin/rm -f %t/shc/%i.pid +ExecStart=/usr/bin/podman start %i +ExecStop=/usr/bin/podman stop --ignore %i + +RuntimeDirectory=shc +RuntimeDirectoryPreserve=yes + +[Install] +WantedBy=default.target diff --git a/debian/rules b/debian/rules index d3dc1cc69f7c6fa86c9956e0d2550e1ebe830c7b..c6a735fec25c63996e942a926774f6f6a046f368 100755 --- a/debian/rules +++ b/debian/rules @@ -16,3 +16,6 @@ execute_after_dh_auto_install: override_dh_fixperms: dh_fixperms --exclude usr/bin/shc + +override_dh_installsystemd: + dh_installsystemd --name shc@ shc@.service