summaryrefslogtreecommitdiff
path: root/data/templates/container/systemd-unit.j2
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-10-29 21:06:19 +0200
committerGitHub <noreply@github.com>2022-10-29 21:06:19 +0200
commit73525515927631a4c6319a215fd93fb2a1ea11e2 (patch)
treed4a727eeabd45f1e19cf169ed5dbd07a25268fad /data/templates/container/systemd-unit.j2
parentdda62226353ebc198b4dbbd319412bb5d1d1ece2 (diff)
parentac73bc2db85bd1c7c28bd41a3f7b7e31ee57ce3f (diff)
downloadvyos-1x-73525515927631a4c6319a215fd93fb2a1ea11e2.tar.gz
vyos-1x-73525515927631a4c6319a215fd93fb2a1ea11e2.zip
Merge pull request #1628 from sarthurdev/T3903
containers: T3903: Use systemd to handle containers
Diffstat (limited to 'data/templates/container/systemd-unit.j2')
-rw-r--r--data/templates/container/systemd-unit.j217
1 files changed, 17 insertions, 0 deletions
diff --git a/data/templates/container/systemd-unit.j2 b/data/templates/container/systemd-unit.j2
new file mode 100644
index 000000000..fa48384ab
--- /dev/null
+++ b/data/templates/container/systemd-unit.j2
@@ -0,0 +1,17 @@
+### Autogenerated by container.py ###
+[Unit]
+Description=VyOS Container {{ name }}
+
+[Service]
+Environment=PODMAN_SYSTEMD_UNIT=%n
+Restart=on-failure
+ExecStartPre=/bin/rm -f %t/%n.pid %t/%n.cid
+ExecStart=/usr/bin/podman run \
+ --conmon-pidfile %t/%n.pid --cidfile %t/%n.cid --cgroups=no-conmon \
+ {{ run_args }}
+ExecStop=/usr/bin/podman stop --ignore --cidfile %t/%n.cid -t 5
+ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/%n.cid
+ExecStopPost=/bin/rm -f %t/%n.cid
+PIDFile=%t/%n.pid
+KillMode=none
+Type=forking