diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2022-09-14 13:08:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-14 13:08:04 +0200 |
commit | ae20f19351c03398d10ba94a31f21dcf3d86f31c (patch) | |
tree | 80008c80b1aa90e8990965151879b3297c43cc9e /pkg/systemd | |
parent | 940126836022157e615d80cc42eb2b490ae8068d (diff) | |
parent | fe04c86a242f1c61d8f5e0afdc8aa84851265550 (diff) | |
download | podman-ae20f19351c03398d10ba94a31f21dcf3d86f31c.tar.gz podman-ae20f19351c03398d10ba94a31f21dcf3d86f31c.tar.bz2 podman-ae20f19351c03398d10ba94a31f21dcf3d86f31c.zip |
Merge pull request #15777 from vrothberg/fix-14546
generate systemd: fix pod dependencies
Diffstat (limited to 'pkg/systemd')
-rw-r--r-- | pkg/systemd/generate/pods.go | 3 | ||||
-rw-r--r-- | pkg/systemd/generate/pods_test.go | 22 |
2 files changed, 13 insertions, 12 deletions
diff --git a/pkg/systemd/generate/pods.go b/pkg/systemd/generate/pods.go index d691688b8..729a038a5 100644 --- a/pkg/systemd/generate/pods.go +++ b/pkg/systemd/generate/pods.go @@ -92,7 +92,7 @@ type podInfo struct { Requires []string } -const podTemplate = headerTemplate + `Requires={{{{- range $index, $value := .RequiredServices -}}}}{{{{if $index}}}} {{{{end}}}}{{{{ $value }}}}.service{{{{end}}}} +const podTemplate = headerTemplate + `Wants={{{{- range $index, $value := .RequiredServices -}}}}{{{{if $index}}}} {{{{end}}}}{{{{ $value }}}}.service{{{{end}}}} Before={{{{- range $index, $value := .RequiredServices -}}}}{{{{if $index}}}} {{{{end}}}}{{{{ $value }}}}.service{{{{end}}}} {{{{- if or .Wants .After .Requires }}}} @@ -252,6 +252,7 @@ func generatePodInfo(pod *libpod.Pod, options entities.GenerateSystemdOptions) ( StopTimeout: stopTimeout, GenerateTimestamp: true, CreateCommand: createCommand, + RunRoot: infraCtr.Runtime().RunRoot(), } return &info, nil } diff --git a/pkg/systemd/generate/pods_test.go b/pkg/systemd/generate/pods_test.go index 69a654db3..45a2b9eeb 100644 --- a/pkg/systemd/generate/pods_test.go +++ b/pkg/systemd/generate/pods_test.go @@ -71,7 +71,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service [Service] @@ -99,7 +99,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service [Service] @@ -125,7 +125,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service # User-defined dependencies @@ -153,7 +153,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service # User-defined dependencies @@ -181,7 +181,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service # User-defined dependencies @@ -209,7 +209,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service # User-defined dependencies @@ -267,7 +267,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service [Service] @@ -294,7 +294,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service [Service] @@ -322,7 +322,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service [Service] @@ -350,7 +350,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service [Service] @@ -378,7 +378,7 @@ Documentation=man:podman-generate-systemd(1) Wants=network-online.target After=network-online.target RequiresMountsFor=/var/run/containers/storage -Requires=container-1.service container-2.service +Wants=container-1.service container-2.service Before=container-1.service container-2.service [Service] |