summaryrefslogtreecommitdiff
path: root/contrib/systemd
diff options
context:
space:
mode:
authorBoaz Shuster <boaz.shuster.github@gmail.com>2021-06-08 00:41:10 +0300
committerBoaz Shuster <boaz.shuster.github@gmail.com>2021-06-13 15:04:34 +0300
commit302b3084ebadb13a0b203eac63e24b0e5d3535a0 (patch)
tree21465ba5486b7993d4b34ce3554e723e50d248f9 /contrib/systemd
parenta2e1df80bcf71c11d10cc78b49fab4b8909b86e5 (diff)
downloadpodman-302b3084ebadb13a0b203eac63e24b0e5d3535a0.tar.gz
podman-302b3084ebadb13a0b203eac63e24b0e5d3535a0.tar.bz2
podman-302b3084ebadb13a0b203eac63e24b0e5d3535a0.zip
Restart all containers with restart-policy=always on boot
* Add podman-restart systemd unit file and add it to podman RPM package * Fix podman start to filter all containers + unit test Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
Diffstat (limited to 'contrib/systemd')
-rw-r--r--contrib/systemd/system/podman-restart.service12
-rw-r--r--contrib/systemd/system/podman.service3
2 files changed, 15 insertions, 0 deletions
diff --git a/contrib/systemd/system/podman-restart.service b/contrib/systemd/system/podman-restart.service
new file mode 100644
index 000000000..baf12b3ae
--- /dev/null
+++ b/contrib/systemd/system/podman-restart.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Podman Start All Containers With Restart Policy Set To Always
+Documentation=man:podman-start(1)
+StartLimitIntervalSec=0
+
+[Service]
+Type=oneshot
+Environment=LOGGING="--log-level=info"
+ExecStart=/usr/bin/podman $LOGGING start --all --filter restart-policy=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/contrib/systemd/system/podman.service b/contrib/systemd/system/podman.service
index 7e5195e7a..cefb13ae3 100644
--- a/contrib/systemd/system/podman.service
+++ b/contrib/systemd/system/podman.service
@@ -10,3 +10,6 @@ Type=exec
KillMode=process
Environment=LOGGING="--log-level=info"
ExecStart=/usr/bin/podman $LOGGING system service
+
+[Install]
+WantedBy=multi-user.target