[launchd-dev] Attempting to develop a launch plist for sysmon

Quinn eskimo1 at apple.com
Tue Aug 5 01:46:55 PDT 2008


At 18:09 -0400 1/8/08, Morgan Aldridge wrote:
>I use both the OnDemand and KeepAlive keys in the hopes of supporting
>both Tiger & Leopard with this file. Will I run into any issues there
>(I've currently only tested with Leopard Server)?

As long as you still need to support 10.4.x you'd be better off just 
using "OnDemand".  It's supported, albeit deprecated, on 10.5.

At 12:51 -0700 4/8/08, Nathan Wan wrote:
>I also have a question about this.  I have been looking at the man page for
>launchd.plist on 10.4, and it does not list a KeepAlive key.  Does that mean
>that it won't work?  It doesn't seem to be working.  Is there another way to
>keep a daemon running another way?

"KeepAlive" will not work on 10.4.x.  "OnDemand" is your only choice. 
It's not as flexible, but it will do the job.

At 18:09 -0400 1/8/08, Morgan Aldridge wrote:
>Any ideas as to what might cause this? Will I have to start
>investigating sysmond's source to see if it's a dependency checking
>issue? Shouldn't the file system be available upon loading the job and
>only network services might be unavailable?

My guess is that this is related to networking.  Startup items, since 
10.4, have automatically been given a dependency on networking for 
compatibility reasons.  If you convert to launchd, you lose that 
dependency and it's likely you come up /way/ before the networking 
stack.  Lots of traditional UNIX code doesn't handle that well.

Just for the sake of debugging this, have you tried adding 
"NetworkState" to your property list (in the "KeepAlive" dictionary, 
as documented by <x-man-page://5/launchd.plist>).  This will prevent 
you from coming up until the network is up.  It's not the long-term 
solution to this problem, but it would allow you determine whether 
the problem is networking or something else.

S+E
-- 
Quinn "The Eskimo!"                    <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware


More information about the launchd-dev mailing list