Launchd wrangling
Axel Luttgens
luttgens at fusl.ac.be
Mon Jul 23 02:53:04 PDT 2007
On 23/07/07 11:14, Norman Gray wrote:
>
> Greetings.
>
> Can anyone advise me how to debug a launchd task?
Well, system.log should provide some info, especially when the task's
plist has a "Debug" key (set to the boolean value true).
On the other hand, you could also have a look at the man page for
launchd_debugd(8), even if it isn't likely to be of great help.
> [...]
>
>
> [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>
This must be the main source of the troubles you are encountering:
LaunchAgents are somewhat problematic.
You may find more info about this in the thread "launchd question" that
started on February, 27th.
Another problem is with launchd itself, when asked to perform
periodic/calendar tasks: they are affected by some bugs since the early
days of Tiger.
I would say that the most reliable way to handle such tasks is cron,
which is still with us and very healthy.
HTH,
Axel
More information about the MacOSX-admin
mailing list