[launchd-dev] Run job when network configuration changes

Dave Zarzycki zarzycki at apple.com
Wed Dec 5 09:09:19 PST 2007


On Dec 5, 2007, at 7:04 AM, Jeremy Reichman wrote:

> On 12/5/07 4:02 AM, "Kevin Van Vechten" <kvv at apple.com> wrote:
>
>> I agree this would be a very useful feature, but there are subtleties
>> that complicate the implementation of what seems like a
>> straightforward idea (for example, Launchd cannot be a direct client
>> of SystemConfiguration without fear of deadlock as  
>> SystemConfiguration
>> talks to the launchd-managed daemon configd).  Nevertheless, we are
>> exploring ways to broaden the set of events that can be specified  
>> in a
>> launchd plist.
>
> I would be just as happy if there were a file that was consistently  
> and
> reliably modified during network changes, so that the WatchPaths key  
> could
> be used. I'm not aware of such a file and past discussions about  
> this on the
> MacEnterprise list haven't turned one up (to my recollection), but  
> that
> doesn't mean it doesn't exist.

The problem is that "network changed" is vague. It means different  
things to different people.

Does it include updates to the list of DNS servers?
Does it include updates to the DNS database?
What about when the default route changes?
What about if any route is added or deleted?
What about when interfaces go on and offline?
What about when interfaces are added or removed?
What about when the computer switches between wireless base stations?
What about when the computer updates the IP address(es) assigned to an  
interface?
Does network change notification include explicit testing for the  
presence or absence of a given node?
Does it include updates to proxy configuration details?
Does it include updates to the list of LDAP servers the machine is  
using?
Does it include updates to the list of Kerberos servers being used?
What about when the ARP table updates?

One can easily make "slippery-slope" arguments towards the "network  
change" notification firing continuously… As a consequence of both  
real and contrived examples, we frequently advise that developers  
write a program to use the System Configuration framework to directly  
narrow down the criteria that they are specifically interested in.

*shrug*

davez


More information about the launchd-dev mailing list