Commit 071bc0b
committed
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.1 parent 8fad4af commit 071bc0b
3 files changed
+72
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
972 | 972 | | |
973 | 973 | | |
974 | 974 | | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
981 | 978 | | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
986 | 991 | | |
987 | 992 | | |
988 | 993 | | |
989 | 994 | | |
990 | 995 | | |
991 | | - | |
| 996 | + | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
| 1002 | + | |
992 | 1003 | | |
993 | 1004 | | |
994 | 1005 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
214 | 236 | | |
215 | 237 | | |
216 | 238 | | |
| |||
240 | 262 | | |
241 | 263 | | |
242 | 264 | | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
243 | 287 | | |
244 | 288 | | |
245 | 289 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
129 | 133 | | |
130 | 134 | | |
131 | 135 | | |
| |||
0 commit comments