Any ideas how to resolve the error that shows up in the Mac OSX system.log file? Or even what the error means?
I have the following cron job that runs every minute:
* * * * * cd /Library/[...]/report/ && nice -n 15 /usr/local/php5/bin/php -f report_generator.php > /dev/null 2>&1
Searches around the internet mentioning commenting out the cron job, but in my cause I can't do this. Most of Google's search results also don't have conclusive mention of what the error actually means.
The full error is:
Jul 2 14:50:00 xserve2 com.apple.launchd[1] (0x10c3f0.cron[46328]): Could not setup Mach task special port 9: (os/kern) no access
Mac OSX 10.5
I'm aware this won't quite fix the original issue but hopefully will tell us if the issue is a bug in
launchd
or something else.Have you tried removing the
cron
job and re-instituting it as a properlaunchd
job instead?launchd
is supposed to run thecron
jobs but it sounds like you may be running into a bug.You can create a
launchd
job using a GUI such as Lingon if you'd prefer instead of making the .plist yourself.Sample .plist:
From my Googling it sounds like it's a bug in
launchd
runningcron
jobs. Source: 1StartInterval will simply run it that many seconds from when the job was last run. StartCalendarInterval will allow you to run it at set times and instead of the
<key>StartInterval</key>
in the sample above use the following:Run only at 3:15 AM
Run every 5 minutes - StartCalendarInterval with an array. (I don't know of a better way to write this out so I'd love someone to elaborate on this)
For more check out the Migrating from cron section on the documentation for launchd and man page
The entry in the system log seems to be made by the launchd application itself, with the (child) sub-process of the cron job in brackets. The entry is not tied to any particular cron job, but happens on every occasion that any cron job runs: I have jobs that run once a day and a job that runs every 5 minutes, with log entries (Could not setup Mach task special port 9: (os/kern) no access) on each and every occasion. The problem must be part of the procedure of running a cron job (external to that cron job) and is probably to be found in one of the lib files that are part of the cron process, such as '/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation', for example. The problem is unlikely to be part of launchd, as it only occurs when cron is invoked.
Convoluted though it may be, the best way to stop the log entries, while permitting the jobs to run, is to cut out the middle-man - cron - and run the job direct from launchd. Examples of how to achieve that are numerous (see above for a start)!
Darryl,
Without knowing what that script does (or who's crontab it is), I'd suggest that you first try to run it from the command line as that user.
Offhand, it appears that it's a permissions thing. Can you provide more information?
More searching revealed two forum threads on the subject:
http://discussions.apple.com/thread.jspa?threadID=1224189&start=0&tstart=0
http://discussions.apple.com/thread.jspa?messageID=5666826�
Hope that helps!