site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com On Aug 5, 2008, at 10:58 AM, Maxim Zhuravlev wrote: Hi, Dave. Actually, some questions arise on the way: 1) Are there any launchd-provided or another *out-of-the-box* ways to distinguish, whether the daemon is launched at boot time or by WatchPaths paths modification, so that it can decide to proceed with conditional or unconditional processing respectively? Maxim, 2) And still, if I refactor my code to use ex. sockets, how do I change RunAtLoad key value from within the daemon? Would launch_data_set_bool (runatload_key, ( user_defined_value == true_value ) ? true: false ) be enough, or do I need to send some message? I insist, cause this seems to be the most elegant way so far. davez _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... We'd advise against using the launchd configuration file as a substitute for a real configuration file. Please consider just leaving "RunAtLoad" == true and then have your program read a configuration file to determine whether any action is necessary. No. This is intentional. We don't want users to reboot their computers unless the kernel, drivers or firmware has been updated. To further this goal, we try hard to hide the fact that the first launch of a program is due to booting up as opposed to some other criteria. However, one is free to store a side database. In that, one can cache WatchPath modification dates / details. One can then use these values to determine whether to proceed with other transactions. Just set RunAtLoad to true in the property-list and have the job early exit if it finds no work to do. This email sent to site_archiver@lists.apple.com