summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-06-03 16:36:18 +0200
committerGitHub <noreply@github.com>2022-06-03 16:36:18 +0200
commit1d04e8641d4abab6ce978bc2dc5523c2ddb2f628 (patch)
tree742564159535d13dd060074187be79616da2bb3f /services
parentAllow postgres integration tests to run over unix pipe (#19875) (diff)
downloadforgejo-1d04e8641d4abab6ce978bc2dc5523c2ddb2f628.tar.xz
forgejo-1d04e8641d4abab6ce978bc2dc5523c2ddb2f628.zip
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 <art27@cantab.net>
Diffstat (limited to 'services')
-rw-r--r--services/mailer/mailer.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/services/mailer/mailer.go b/services/mailer/mailer.go
index 3ca9b50fc6..f4bc2ddc63 100644
--- a/services/mailer/mailer.go
+++ b/services/mailer/mailer.go
@@ -281,6 +281,7 @@ func (s *sendmailSender) Send(from string, to []string, msg io.WriterTo) error {
if err != nil {
return err
}
+ process.SetSysProcAttribute(cmd)
if err = cmd.Start(); err != nil {
_ = pipe.Close()