On Thu, Mar 26, 2009 at 04:17:01PM -0400, James Carlson wrote: > Alan Maguire writes: > > in investigating a problem with a system() initiated > > execution of "pkill -9 dhcpagent" that we require > > as part of our shutdown procedure in the nwam daemon, > > it occurred to me that we could use process contract > > information to do a cleaner sigsend() to all the members > > in the contract (see http://blogs.sun.com/lianep/entry/how_does_kill_work). > > This would have the added benefit that it would kill any > > ENM scripts that were still running (as we spawn those > > also). Is there a reason not to pursue that approach perhaps? > > CR 6696321, I think.
Hmm. I think Alan's looking for a way to workaround a slightly different aspect of 6696321 that's been problematic for nwam: if nwamd is the thing that first launches dhcpagent (and it usually is), then dhcpagent winds up in nwam's contract. So in order for the nwam service to shut down properly, dhcpagent must exit as well. But nwamd needs to communicate with dhcpagent "on the way down", as it usually needs to release dhcp leases as part of its normal shutdown. So, nwamd winds up needing to kill dhcpagent (this is why the nwam service stop method is an explicit pkill of nwamd, rather than the simpler :kill). Once 6696321 is fixed, that particular problem goes away: dhcpagent is no longer part of nwamd's contract, so nwamd can shutdown, asking dhcpagent to do work for it on the way down, and then dhcpagent can stick around and/or shut itself down according to its own rules. And since it's no longer in nwam's contract, the sigsend() that Alan is suggesting will no longer affect dhcpagent (but will still pick up those enm scripts he mentions). This seems like a good approach to me; am I missing something? -renee
