Description of problem: Sometimes, journal has message systemd: usbguard.service: Supervising process 1059 which is not our child. We'll most likely not notice when it exits. in it. Version-Release number of selected component (if applicable): usbguard-1.0.0-10.el9.aarch64 How reproducible: Very non-deterministic. Steps to Reproduce: 1. Have usbguard.service enabled. 2. Boot the system. 3. Check journal for "Supervising process" Actual results: systemd: usbguard.service: Supervising process 1059 which is not our child. We'll most likely not notice when it exits. Expected results: No such message. Additional info:
I have a reason to believe that this is caused by a race condition in Daemon::daemonize (upstream currently at https://github.com/USBGuard/usbguard/blob/master/src/Daemon/Daemon.cpp#L586). When the initial process exits (based on that SIGUSR1 that it got) before the first forked process exits, the second forked process whose pid got written to pid_file still has ppid that first forked process. So when systemd checks the ppid for the pid found in the /run/usbguard.pid, it still sees that first forked child, not self.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (usbguard bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:2351