HomeFreeBSD

ctld: Move the pidfile handle out to a global variable

Description

ctld: Move the pidfile handle out to a global variable

This ensures it will be destroyed (removing the associated pidfile)
anytime the process exits, including from exit(3) calls. This fixes
a few places that would "leak" the pidfile on certain errors.

This also removes the need for some convoluted logic where
configuration objects would hand-off ownership of the pidfile handle
from the old configuration to the new configuration.

Reviewed by: asomers
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D56527

(cherry picked from commit aad4fec5d7e260a789456a8cc82b293064fab5f3)

Details

Provenance
jhbAuthored on Apr 23 2026, 7:17 PM
Reviewer
asomers
Differential Revision
D56527: ctld: Move the pidfile handle out to a global variable
Parents
rGb6564c32ea98: ctld: Ports without a portal group are not dummy ports
Branches
Unknown
Tags
Unknown