Launchd wrangling
Norman Gray
norman at astro.gla.ac.uk
Mon Jul 23 02:14:59 PDT 2007
Greetings.
Can anyone advise me how to debug a launchd task?
I have a couple of simple launchd periodic jobs (for example [1])
which work only erratically, running some days and not others.
They're patterned after the examples in [2], and one of them used to
work happily on a different machine (though even there, it used to
run at rather odd times).
If anyone can spot anything amiss with the property list below,
that'd be great, but what I'm really asking here is: how on earth do
I debug this?
Running 'launchctl list' shows _loaded_ jobs (and these are both
loaded), but doesn't indicate whether they're started or stopped.
Indeed after reading [2] quite closely, I'm still very puzzled about
the relationship between loaded/unloaded, started/stopped and
disabled/enabled. There seems to be two concepts here, spread over
three terms.
So:
Is there a way of getting a less laconic indication of what launchd
thinks its state is?
Is there a log file I'm missing? Something is stopping these jobs
running, and presumably launchd is telling me about it somewhere, but
I can't find it. There are a few remarks from launchd in /var/log/
asl.log about a process exiting abnormally, but no indication of
which process it was, nor whether launchd regarded this as a major
problem.
Thanks for any pointers. Best wishes,
Norman
[1] This is in ~/Library/LaunchAgents:
<?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>LowPriorityIO</key>
<true/>
<key>Nice</key>
<integer>1</integer>
<key>ProgramArguments</key>
<array>
<string>/Users/norman/local/bin/grok-battery-info</
string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>12</integer>
<key>Minute</key>
<integer>10</integer>
</dict>
<key>label</key>
<string>localhost.nxg-battery-status</string>
</dict>
</plist>
[2] <http://developer.apple.com/macosx/launchd.html>, and <http://
developer.apple.com/documentation/MacOSX/Conceptual/BPSystemStartup/
index.html> simply gives another example launchd plist.
--
------------------------------------------------------------
Norman Gray : http://nxg.me.uk
eurovotech.org : University of Leicester, UK
More information about the MacOSX-admin
mailing list