Re: Fwd: StartupItems
Re: Fwd: StartupItems
- Subject: Re: Fwd: StartupItems
- From: email@hidden (Peter Seebach)
- Date: Sun, 04 Jun 2006 14:22:58 -0500
Hmm. Well, maybe someone can tell me what I'm doing wrong with launchd.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>localhost.script_name</string>
<key>UserName</key>
<string>kodak</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/program</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
This launchd item, placed in /Library/LaunchDaemons, never gets run.
Why?
Jun 4 12:06:18 localhost launchd: localhost.script_name: getpwnam("kodak") failed
Jun 4 12:06:18 localhost launchd: localhost.script_name: exited with exit code: 1
Jun 4 12:06:18 localhost launchd: localhost.script_name: 9 more failures without living at least 60 seconds will cause job removal
Does the user exist? Why, yes. This is not only a user on the system, but
the user that gets automatically logged in once the system is booted.
So what happens? Launchd tries to launch this before the netinfo stuff is all
up, and ends up yanking it from the job list, not because the script or daemon
is problematic... But because the UserName key isn't viable yet.
It doesn't matter what's in the ProgramArguments, because the program never
gets to being spawned, because the UserName doesn't work.
Doesn't this mean launchd ought to, hmm. Maybe check for availability of
NetInfo before trying to spawn a job, then killing it for lack of resources?
If "don't just suicide when your resources aren't available" is such good
advice for programs in a launchd world, why doesn't launchd follow it?
-s
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden