mirror of
https://github.com/containers/podman
synced 2024-10-19 16:54:07 +00:00
Set PATH env in systemd timer.
This fixes an issue where binaries that are in the path of the original podman process are not found in the transient systemd timer for healthchecks. This showed up for me on a NixOS machine since binaries are not installed in the usual places. Signed-off-by: Marco Munizaga <git@marcopolo.io>
This commit is contained in:
parent
e239bfa15b
commit
a8cb43d3a9
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue