summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-11-23 21:33:05 +0100
committerGitHub <noreply@github.com>2020-11-23 21:33:05 +0100
commitcd6c4cb0affdb1e8a647079b2808da6bf833d543 (patch)
tree813fc55027c1706f7bf0f2a708ea7538be985a1f
parent5d55285188f15eb7662b25a3fd2915a4a72591ba (diff)
parenta8cb43d3a96f173a6f33f7f11325a51b55587a37 (diff)
downloadpodman-cd6c4cb0affdb1e8a647079b2808da6bf833d543.tar.gz
podman-cd6c4cb0affdb1e8a647079b2808da6bf833d543.tar.bz2
podman-cd6c4cb0affdb1e8a647079b2808da6bf833d543.zip
Merge pull request #8438 from MarcoPolo/marco/set-path-for-systemd-healthcheck
Set PATH env in systemd timer.
-rw-r--r--libpod/healthcheck_linux.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/healthcheck_linux.go b/libpod/healthcheck_linux.go
index b0f1ff35d..0ad15da09 100644
--- a/libpod/healthcheck_linux.go
+++ b/libpod/healthcheck_linux.go
@@ -26,6 +26,10 @@ func (c *Container) createTimer() error {
if rootless.IsRootless() {
cmd = append(cmd, "--user")
}
+ path := os.Getenv("PATH")
+ if path != "" {
+ cmd = append(cmd, "--setenv=PATH="+path)
+ }
cmd = append(cmd, "--unit", c.ID(), fmt.Sprintf("--on-unit-inactive=%s", c.HealthCheckConfig().Interval.String()), "--timer-property=AccuracySec=1s", podman, "healthcheck", "run", c.ID())
conn, err := systemd.ConnectToDBUS()