diff options
author | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2022-10-28 21:27:37 +0200 |
---|---|---|
committer | sarthurdev <965089+sarthurdev@users.noreply.github.com> | 2022-10-29 17:59:49 +0200 |
commit | f9c1277f5cf56fba2fc773d133de0221b06fa511 (patch) | |
tree | 2c2fa6c9706f062c49cec3a2c472b81350c15c49 /data/templates/container | |
parent | 5f26d80a262dacbff750a22b670a9b8411773174 (diff) | |
download | vyos-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')
-rw-r--r-- | data/templates/container/systemd-unit.j2 | 17 |
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 |