summaryrefslogtreecommitdiff
path: root/data/templates/container/systemd-unit.j2
diff options
context:
space:
mode:
authorsarthurdev <965089+sarthurdev@users.noreply.github.com>2022-10-28 21:27:37 +0200
committersarthurdev <965089+sarthurdev@users.noreply.github.com>2022-10-29 17:59:49 +0200
commitf9c1277f5cf56fba2fc773d133de0221b06fa511 (patch)
tree2c2fa6c9706f062c49cec3a2c472b81350c15c49 /data/templates/container/systemd-unit.j2
parent5f26d80a262dacbff750a22b670a9b8411773174 (diff)
downloadvyos-1x-f9c1277f5cf56fba2fc773d133de0221b06fa511.tar.gz
vyos-1x-f9c1277f5cf56fba2fc773d133de0221b06fa511.zip
containers: T3903: Use systemd units for containers
* ExecStop action with defined timeout allows for quicker reboot/shutdown with 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