git: bc249f68c569 - stable/14 - syslogd: Allow killing when in foreground

From: Dag-Erling Smørgrav <des_at_FreeBSD.org>
Date: Thu, 02 Apr 2026 09:56:59 UTC
The branch stable/14 has been updated by des:

URL: https://cgit.FreeBSD.org/src/commit/?id=bc249f68c569efee2ba70319e5bcfe942fd7620e

commit bc249f68c569efee2ba70319e5bcfe942fd7620e
Author:     Dag-Erling Smørgrav <des@FreeBSD.org>
AuthorDate: 2026-03-24 10:58:53 +0000
Commit:     Dag-Erling Smørgrav <des@FreeBSD.org>
CommitDate: 2026-04-02 09:56:10 +0000

    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.
    
    MFC after:      1 week
    Reviewed by:    jfree
    Differential Revision:  https://reviews.freebsd.org/D55886
    
    (cherry picked from commit 828de702ada854b5f09f447ba06e4e08e976ba07)
---
 usr.sbin/syslogd/syslogd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 7356fb3fa43f..be12e8db7b85 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -781,8 +781,8 @@ main(int argc, char *argv[])
 	    sizeof(consfile.fu_fname));
 	(void)strlcpy(bootfile, getbootfile(), sizeof(bootfile));
 	(void)signal(SIGTERM, dodie);
-	(void)signal(SIGINT, Debug ? dodie : SIG_IGN);
-	(void)signal(SIGQUIT, Debug ? dodie : SIG_IGN);
+	(void)signal(SIGINT, (Foreground || Debug) ? dodie : SIG_IGN);
+	(void)signal(SIGQUIT, (Foreground || Debug) ? dodie : SIG_IGN);
 	(void)signal(SIGHUP, sighandler);
 	(void)signal(SIGCHLD, sighandler);
 	(void)signal(SIGALRM, domark);