mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
syslogd: Allow killing when in foreground
Normally, syslogd reacts only to SIGTERM, and ignores SIGINT and SIGQUIT unless in debug mode. Extend that to also apply when running in the foreground. Take this opportunity to comment the event loop. MFC after: 1 week Reviewed by: jfree Differential Revision: https://reviews.freebsd.org/D55886
This commit is contained in:
1 parent
2e1cf24229
commit
828de702ad
1 file changed
+8
-2
@@ -781,15 +781,21 @@ main(int argc, char *argv[])
|
||||
case EVFILT_SIGNAL:
|
||||
switch (ev.ident) {
|
||||
case SIGHUP:
|
||||
/* Reload */
|
||||
init(true);
|
||||
break;
|
||||
case SIGINT:
|
||||
case SIGQUIT:
|
||||
/* Ignore these unless -F and / or -d */
|
||||
if (!Foreground && !Debug)
|
||||
break;
|
||||
/* FALLTHROUGH */
|
||||
case SIGTERM:
|
||||
if (ev.ident == SIGTERM || Debug)
|
||||
die(ev.ident);
|
||||
/* Terminate */
|
||||
die(ev.ident);
|
||||
break;
|
||||
case SIGALRM:
|
||||
/* Mark and flush */
|
||||
markit();
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user