don't propagate SIGHUP ignore to child processes

Related: https://pagure.io/koji/issue/672
This commit is contained in:
Tomas Kopecek 2022-06-15 11:44:09 +02:00
parent b5ff9d8b51
commit 2006ab1dd8

View file

@ -584,8 +584,9 @@ def daemonize():
if pid:
os._exit(0)
os.setsid()
signal.signal(signal.SIGHUP, signal.SIG_IGN)
# fork again
# fork again, no need to ignore SIGHUP
# https://pagure.io/koji/issue/672
# https://code.activestate.com/recipes/278731-creating-a-daemon-the-/
pid = os.fork()
if pid:
os._exit(0)