mirror of https://github.com/k3s-io/k3s
Fix log/reap reexec
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>pull/4385/head
parent
702fe24afe
commit
f9f1cabe9c
|
@ -58,7 +58,7 @@ func forkIfLoggingOrReaping() error {
|
||||||
args := append([]string{version.Program}, os.Args[1:]...)
|
args := append([]string{version.Program}, os.Args[1:]...)
|
||||||
env := append(os.Environ(), "_K3S_LOG_REEXEC_=true", "NOTIFY_SOCKET=")
|
env := append(os.Environ(), "_K3S_LOG_REEXEC_=true", "NOTIFY_SOCKET=")
|
||||||
cmd := &exec.Cmd{
|
cmd := &exec.Cmd{
|
||||||
Path: os.Args[0],
|
Path: "/proc/self/exe",
|
||||||
Dir: pwd,
|
Dir: pwd,
|
||||||
Args: args,
|
Args: args,
|
||||||
Env: env,
|
Env: env,
|
||||||
|
@ -66,7 +66,7 @@ func forkIfLoggingOrReaping() error {
|
||||||
Stdout: stdout,
|
Stdout: stdout,
|
||||||
Stderr: stderr,
|
Stderr: stderr,
|
||||||
SysProcAttr: &syscall.SysProcAttr{
|
SysProcAttr: &syscall.SysProcAttr{
|
||||||
Setsid: true,
|
Pdeathsig: unix.SIGTERM,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
if err := cmd.Start(); err != nil {
|
if err := cmd.Start(); err != nil {
|
||||||
|
|
Loading…
Reference in New Issue