When certain other options are also specified it might work correctly, but with -R alone, "supervise mode" doesn't kick in. Using -R alone used to work on previous versions. diff --git i/usr.sbin/daemon/daemon.c w/usr.sbin/daemon/daemon.c index da8e4895e19b..52fbfca1dcd2 100644 --- i/usr.sbin/daemon/daemon.c +++ w/usr.sbin/daemon/daemon.c @@ -240,12 +240,13 @@ main(int argc, char *argv[]) case 'R': state.restart_enabled = true; state.restart_delay = strtol(optarg, &p, 0); if (p == optarg || state.restart_delay < 1) { errx(6, "invalid restart delay"); } + state.mode = MODE_SUPERVISE; break; case 's': state.syslog_priority = get_log_mapping(optarg, prioritynames); if (state.syslog_priority == -1) { errx(4, "unrecognized syslog priority");
LGTM (will commit later this evening, ~6-8 hours, if nobody else beats me to it)
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=bbc6e6c5ec8c7938b98a36899fa083aa7ce4724e commit bbc6e6c5ec8c7938b98a36899fa083aa7ce4724e Author: Mathieu <sigsys@gmail.com> AuthorDate: 2024-04-14 03:10:06 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2024-04-14 03:12:36 +0000 daemon: fix -R to enable supervision mode If we're doing restarts, then we must supervise -- the 'R' case simply got missed. PR: 278342 Fixes: f907027b49d ("daemon: set supervise_enabled during [..]") usr.sbin/daemon/daemon.c | 1 + 1 file changed, 1 insertion(+)
MFC'ing this to stable/13 and stable/14, but not shooting for an EN since it's a relatively minor issue that has a clear workaround w/o side effect (specify -r as well).
A commit in branch stable/14 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a871d0f13c56f6ea2ec86ed8175634b562de514a commit a871d0f13c56f6ea2ec86ed8175634b562de514a Author: Mathieu <sigsys@gmail.com> AuthorDate: 2024-04-14 03:10:06 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2024-04-17 05:48:26 +0000 daemon: fix -R to enable supervision mode If we're doing restarts, then we must supervise -- the 'R' case simply got missed. PR: 278342 Fixes: f907027b49d ("daemon: set supervise_enabled during [..]") (cherry picked from commit bbc6e6c5ec8c7938b98a36899fa083aa7ce4724e) usr.sbin/daemon/daemon.c | 1 + 1 file changed, 1 insertion(+)
A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=1e2be096d4252308db35b0424bd408c2b8aa5990 commit 1e2be096d4252308db35b0424bd408c2b8aa5990 Author: Mathieu <sigsys@gmail.com> AuthorDate: 2024-04-14 03:10:06 +0000 Commit: Kyle Evans <kevans@FreeBSD.org> CommitDate: 2024-04-17 05:50:03 +0000 daemon: fix -R to enable supervision mode If we're doing restarts, then we must supervise -- the 'R' case simply got missed. PR: 278342 Fixes: f907027b49d ("daemon: set supervise_enabled during [..]") (cherry picked from commit bbc6e6c5ec8c7938b98a36899fa083aa7ce4724e) usr.sbin/daemon/daemon.c | 1 + 1 file changed, 1 insertion(+)
Thanks for the report!