10.4: One solution to a launchd-cron CPU usage issue

Sep 15, '05 09:09:00AM

Contributed by: tob

Tiger only hintAfter upgrading to 10.4, I found that launchd was eating up much CPU time (around 15%).

Investigating this strange behavior, I noticed that cron was started several times per second! The file com.vix.cron.plist (in /System -> Library -> LaunchDaemons) responsible for cron contains this entry:


  <key>QueueDirectories</key>
  <array>
    <string>/var/cron/tabs</string>
  </array>
This causes cron to watch the /var/cron/tabs directory for new crontabs, which is a good thing. But in my case, this directory also contained a .DS_Store file. The Finder uses this file to store various information such as window location, icon position, etc. For some reason, launchd choked on this file, even though it was never updated. After removing the file with sudo rm -f /var/cron/tabs/.DS_Store, I found that launchd behaved as expected, and CPU usage was back to normal.

As always, please be extremely careful when using rm -f as root (sudo), as you can do much damage to important files and directories with just one typo!

Comments (8)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20050913185249359