-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pty.c: Open PTY slave with O_NOCTTY.
Up until now, the BBS has received a SIGHUP whenever remote consoles exited, which originally caused the BBS to exit when the BBS was daemonized. Workarounds were added for this, beginning with commit 5952cfb. However, the underlying cause of the SIGHUP was a single open() call lacking O_NOCTTY, resulting in acquisition of a controlling terminal. By providing this flag, we prevent this from happening, ensuring that we don't receive unwanted SIGHUP signals. Previously, if running under systemd, because we don't daemonize, SIGHUP wasn't ignored, and thus a remote console exiting would result in SIGHUP killing the BBS. We still continue to ignore SIGHUP, because when running under systemd, the BBS still receives a SIGHUP, in the same manner as addressed in commit ea38bdc. We use SIGUSR2 for processing reloads from systemd, so there's not much downside to ignoring SIGHUP to ensure these things aren't conflated. However, because we don't daemonize when running under systemd, but because STDOUT isn't a TTY in this scenario, we now also ignore SIGHUP if STDOUT is not a TTY. In other words, it's less whether we're daemonized and more whether STDOUT is connected to a terminal that determines whether we ignore SIGHUP.
- Loading branch information
1 parent
8fad4af
commit 071bc0b
Showing
3 changed files
with
72 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters