summaryrefslogtreecommitdiff
path: root/pkg/systemd/define
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-09-06 14:49:59 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-09-07 13:58:11 +0200
commitd1573b95e3427efae21da784e3112c5fb3d463fb (patch)
treeda311feeab3105d4577a7d5c4a9a1dc3027603aa /pkg/systemd/define
parente095667ac8c2ccaf06dea6d4c61f51d93b736968 (diff)
downloadpodman-d1573b95e3427efae21da784e3112c5fb3d463fb.tar.gz
podman-d1573b95e3427efae21da784e3112c5fb3d463fb.tar.bz2
podman-d1573b95e3427efae21da784e3112c5fb3d463fb.zip
generate systemd: handle --restart
Handle custom restart policies of containers when generating the unit files; those should be set on the unit level and removed from ExecStart flags. Fixes: #11438 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'pkg/systemd/define')
-rw-r--r--pkg/systemd/define/const.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkg/systemd/define/const.go b/pkg/systemd/define/const.go
index 1b50be5db..6bab8b629 100644
--- a/pkg/systemd/define/const.go
+++ b/pkg/systemd/define/const.go
@@ -1,8 +1,13 @@
package define
-// EnvVariable "PODMAN_SYSTEMD_UNIT" is set in all generated systemd units and
-// is set to the unit's (unique) name.
-const EnvVariable = "PODMAN_SYSTEMD_UNIT"
+const (
+ // Default restart policy for generated unit files.
+ DefaultRestartPolicy = "on-failure"
+
+ // EnvVariable "PODMAN_SYSTEMD_UNIT" is set in all generated systemd units and
+ // is set to the unit's (unique) name.
+ EnvVariable = "PODMAN_SYSTEMD_UNIT"
+)
// RestartPolicies includes all valid restart policies to be used in a unit
// file.