[Bug 278342] daemon(8): -R doesn't restart supervised process

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 13 Apr 2024 05:44:19 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278342

            Bug ID: 278342
           Summary: daemon(8): -R doesn't restart supervised process
           Product: Base System
           Version: 14.0-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: sigsys@gmail.com

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");

-- 
You are receiving this mail because:
You are the assignee for the bug.