reload revisited

rlhamil rlhamil at smart.net
Wed Sep 30 10:48:13 UTC 2020


I see in the dhcpd man page: "This is not technically impossible, but it
would require a great deal of work, our resources are extremely limited, and
they  can  be better spent elsewhere.  So please don't complain about this
on the mailing list unless you're prepared to fund a project to implement
this feature, or prepared to do it yourself."

Granted that cleaning up everything and reloading might be substantially
tedious to add (esp. without memory leaks, etc), there's something that's
probably not: delete the PID file (if present) and re-execute yourself with
the same argv. In principle that has the problem that there's not a really
good standard and portable way for a running program to discover the full
path of its executable.

But wondering about that, I found a library (really just a .h and single .c)
that purports to do that for quite a range of OS's, including but not
limited to Linux, some BSDs, Solaris, macOS, etc. And with a dual license
(MIT and a vulgar-named permissive license). 
https://github.com/gpakosz/whereami

Seems to me that that approach would be rather easy to add, give or take any
additional build requirements and testing, of course. Maybe it's a smidge
slower than the hard way to reload, but the result would be very similar to
a manual restart (fresh address space), with the further advantage that the
PID would actually be unchanged; process starters/restarters like Solaris
svc.startd or macOS launchd wouldn't even notice such a restart, since the
original PID never went away.

Aside from the build requirements and testing, the other thing I don't know
off the top of my head is whether the range of platforms supported by
whereami includes all the platforms currently supported by dhcpd.




--
Sent from: http://isc-dhcp-users.2343191.n4.nabble.com/


More information about the dhcp-users mailing list