git: 0d995ef541d7 - stable/13 - syslogd: Allow killing when in foreground

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

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

commit 0d995ef541d79c79098ebf122693d7a3f1b5f25b
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:21 +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 e78e2327be3b..c390c3930a0e 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);