mirror of
https://github.com/k3s-io/k3s.git
synced 2024-06-07 19:41:36 +00:00
Send MAINPID to systemd when reexecing for logfile output
This allows the new process to notify systemd when it is ready. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
This commit is contained in:
parent
a16105b348
commit
5d1a37ee32
|
@ -9,6 +9,7 @@ import (
|
|||
"sync"
|
||||
"time"
|
||||
|
||||
systemd "github.com/coreos/go-systemd/daemon"
|
||||
"github.com/docker/docker/pkg/reexec"
|
||||
"github.com/natefinch/lumberjack"
|
||||
"github.com/rancher/k3s/pkg/version"
|
||||
|
@ -98,7 +99,11 @@ func runWithLogging() error {
|
|||
cmd.Stderr = l
|
||||
cmd.Stdout = l
|
||||
cmd.Stdin = os.Stdin
|
||||
return cmd.Run()
|
||||
if err := cmd.Start(); err != nil {
|
||||
return err
|
||||
}
|
||||
systemd.SdNotify(false, fmt.Sprintf("MAINPID=%d\n", cmd.Process.Pid))
|
||||
return cmd.Wait()
|
||||
}
|
||||
|
||||
func setupLogging() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user