Re: Modifying launchd-compliant daemon's plist from within the deamon.
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=k+wxif9kFuoM2+v9rHOkfvJ6Zr5TWkpCeTRTyA3GAsw=; b=WBCa4p1SxqUMqYUiuevFHB0vi3sfaxfWnp7w9T9zV4jZLdeYYspjBKH4Von4Vx2kDL mNRfsblnAjXbFNz1uQFcETeRThHqiwj7+M4SITqzRBIx2VFo4kF01I9zZT27pj28qCnE TSAbd/1nxAiHO4mUH1BIKfP4H7BtpKA7LJKkU= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=eXHgFxVnenuCcPFBHJeYnIVCHE0fj68irCa9dJEqRQKvzLLM82YDFr7hfqTn/vnKHb hgTeSHURnLTwmU1q4a7y4qIxWiwAxMoEVkjAoqeJNvB3ew+jGszNjEdPCnzXjrdJ8E2W P83yblpAR1u6XwBxSuFwLPU+A4mdX8PSxhcAE= Hi, Dave.
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.
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? 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. Thanks in advance, - Maxim. _______________________________________________ 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... This email sent to site_archiver@lists.apple.com
participants (1)
-
Maxim Zhuravlev