Prevent zombie processes (#16314)
Unfortunately go doesn't always ensure that execd processes are completely waited for. On linux this means that zombie processes can occur. This PR ensures that these are waited for by using signal notifier in serv and passing a context elsewhere. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
365c4e9316
commit
302e8b6d02
3 changed files with 34 additions and 4 deletions
|
@ -66,7 +66,7 @@ func sessionHandler(session ssh.Session) {
|
|||
|
||||
args := []string{"serv", "key-" + keyID, "--config=" + setting.CustomConf}
|
||||
log.Trace("SSH: Arguments: %v", args)
|
||||
cmd := exec.Command(setting.AppPath, args...)
|
||||
cmd := exec.CommandContext(session.Context(), setting.AppPath, args...)
|
||||
cmd.Env = append(
|
||||
os.Environ(),
|
||||
"SSH_ORIGINAL_COMMAND="+command,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue