Mac OS X 10.5.x Special Report: Spotlight problems
Mac OS X 10.5.x Special Report: Spotlight problems
Reader Randall, who seems to have held off on installing Leopard (not an unwise notion!), did finally install it, and returned to find that Spotlight was hogging the CPU and crashing:
Last night, I installed (via Archive & Install, preserve Users) Leopard onto my PBG4 1.5GHz laptop; I let the install finish as I trotted off to bed. This morning, I came into my office, with the fan going as fast as it ever does, CPU usage pegged at 100% (I use MenuMeters to monitor CPU usage in my menu bar), and messages similar to
ReportCrash[5076]: Formulating crash report for process mdworker[5075] com.apple.launchd[1](0x10aa30.mdworker[5075]): Exited abnormally: Bus error
filling up my system.log file at a rate of once every few seconds. I finally used 'launchctl' to turn off SL until I figured out what was going on.
A friend suggested I used 'mdutil -as' and '-aE' to check things out and rebuild it, but I had to turn SL back on using 'launchctl load...' first. After I did that, I checked the SL status, and saw that NO indexing whatsoever had been done at all. Trying again a few seconds later, I noticed that indexing was enabled, and I was no longer getting any of those crash messages in my log. Everything seems to be working fine.
Simply turning SL off and back on again "fixed" whatever issue it was having before. Might be useful information for folks to know.
Randall then provides some Terminal voodoo for turning Spotlight off and on:
To turn Spotlight off:
% sudo launchctl unload /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
and to turn it back on:
% sudo launchctl load /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
To make these changes permanent [until you issue another command], add "-w" (without the quotes) after the unload|load word in the command; this writes out a "disabled" key in the plist (or removes it, in the case of 'load'), making the change persistent until you change it again.
There is, however, no need to talk directly to launchctl; instead, let Lingon do it for you! We really cannot recommend Lingon strongly enough, especially now that launchd is being so heavily used by the system for starting up processes. Please note that there are two current versions of Lingon; the one that works on Leopard (2.0.2) is Leopard-only. Just find com.apple.Spotlight in the System Agents list, and disable it (uncheck Enabled). Then enable it again.
Resources