mirror of
https://github.com/containers/podman.git
synced 2025-06-22 18:08:11 +08:00
Merge pull request #8438 from MarcoPolo/marco/set-path-for-systemd-healthcheck
Set PATH env in systemd timer.
This commit is contained in:
@ -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()
|
||||
|
Reference in New Issue
Block a user