[launchd-dev] Run job when network configuration changes

Jeremy Reichman jaharmi at jaharmi.com
Mon Oct 29 11:55:23 PDT 2007


I'm looking at the new KeepAlive section in the launchd.plist man page,
specifically at the NetworkStatus item.

Could this be used to run a job _once_ whenever the system's network
configuration changes ... a laptop moves from wired to wireless, or moves
from work to home, or the like? But run the same job each time the network
config changes? I'm not quite sure from the description.

I used to be able to add an item to Kicker.xml for SystemConfiguration, but
I hear that's no longer an option. I haven't checked for it yet, myself,
though. Even so, this was not optimal because my edits in Kicker.xml might
have overwritten by Apple in a future software update.

Writing my own daemon is also not an option; this is purely for systems
administration purposes and I'd like to only _add_ a launchd plist and _add_
a script to the system if that's possible. This ability to only add on, not
edit or replace existing config files, is one attraction of launchd at the
systems administration level.

Thanks!


-- 
Jeremy




More information about the launchd-dev mailing list