#672 Koji's child processes ignore SIG_HUP
Closed: Fixed 2 years ago by tkopecek. Opened 6 years ago by mikem.

Originally filed as rhbz#1088233

The daemonize() function in Koji ignores SIGHUP. This function is used by kojid, kojivmd, and kojira (unless they are run with --fg). This is inherited by child processes, which can cause problems for some builds (normally during unit tests). Affected packages include python3 and python-pexpect.


So we either need to stop ignoring sighup, or reset the handler before forking.

As mentioned in the original bug, this snippet argues that ignoring sighup is not necessary:
https://code.activestate.com/recipes/278731-creating-a-daemon-the-/

Side note: when kojid is run through systemd, it is run with --fg and therefore does not ignore sighup.

This should sidestep the issue on Fedora's Koji instance. Can anyone confirm that?

On a side note: A workaround has been applied for python3 upstream.

I've tried few variants with not/ignoring sighup, checked the output and strace calls and it seems safe to me just to remove it. Only moment when I was able to kill the daemon is in that short moment between second fork and exiting the child which makes no sense in real world as there is nothing to fail or hang.

Metadata Update from @tkopecek:
- Custom field Size adjusted to None

2 years ago

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.30

2 years ago

Metadata Update from @tkopecek:
- Issue tagged with: testing-ready

2 years ago

Metadata Update from @mfilip:
- Issue tagged with: testing-done

2 years ago

Commit 2006ab1 relates to this ticket

Login to comment on this ticket.

Metadata
Related Pull Requests
  • #3404 Merged 2 years ago