Skip to content

Commit

Permalink
Merge pull request containers#8438 from MarcoPolo/marco/set-path-for-…
Browse files Browse the repository at this point in the history
…systemd-healthcheck

Set PATH env in systemd timer.
  • Loading branch information
openshift-merge-robot authored Nov 23, 2020
2 parents 5d55285 + a8cb43d commit cd6c4cb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libpod/healthcheck_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cd6c4cb

Please sign in to comment.