From 1d04e8641d4abab6ce978bc2dc5523c2ddb2f628 Mon Sep 17 00:00:00 2001 From: zeripath Date: Fri, 3 Jun 2022 15:36:18 +0100 Subject: Set Setpgid on child git processes (#19865) When Gitea is running as PID 1 git will occassionally orphan child processes leading to (defunct) processes. This PR simply sets Setpgid to true on these child processes meaning that these defunct processes will also be correctly reaped. Fix #19077 Signed-off-by: Andrew Thornton --- modules/markup/external/external.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'modules/markup/external/external.go') diff --git a/modules/markup/external/external.go b/modules/markup/external/external.go index 4fdd4315bc..a587abcc3b 100644 --- a/modules/markup/external/external.go +++ b/modules/markup/external/external.go @@ -124,6 +124,8 @@ func (p *Renderer) Render(ctx *markup.RenderContext, input io.Reader, output io. cmd.Stdin = input } cmd.Stdout = output + process.SetSysProcAttribute(cmd) + if err := cmd.Run(); err != nil { return fmt.Errorf("%s render run command %s %v failed: %v", p.Name(), commands[0], args, err) } -- cgit v1.2.3