Getting El Capitan to run clean

Whenever you complete a major system upgrade, such as installing OS X 10.11 El Capitan, your first concern is to ensure that all your key apps are working fine. Once you have breathed that deep sigh of relief, your next task is to check that OS X is also running fine, by inspecting your logs in Console.

It is common for such major upgrades to have glitches. Major glitches will normally be obvious, as you will discover features or whole apps that do not work. But minor glitches may be more subtle, and only revealed by streams of errors and warnings in the logs.

Once I was happy that El Capitan was ready for use, I opened Console to find, every 10 seconds, the following error reports:
01/10/2015 18:12:07.089[1]: assertion failed: 15A284: launchd + 86915 [13D08717-B23A-38BE-85A6-085B051F8322]: 0x11
01/10/2015 18:12:07.089[1]: ( Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

The reports themselves are not a big deal: yes, they will result in huge logs, but in these days of terabyte drives, those logs will have limited impact on disk space. Yes, every 10 seconds there will be a slight performance hit as launchd goes through that loop again, but it is hardly going to cause beachballing or snarl apps up.

You should be more concerned as to why such errors are occurring. launchd is OS X’s service for starting other services of all kinds. Although the errors do not indicate which service launchd cannot get running, something is missing. It could be an old and crufty service inherited from pre-Yosemite days, in which case, so long as it doesn’t crash hard or disrupt anything else, it is probably not a big deal. But it could be something important which is broken. You need to find out.

Very occasionally problems like this go away of their own accord. So I did not do anything for a while, but got on exploring El Capitan. When I checked Console again, launchd was still hammering away every 10 seconds. My next step was do perform an ordinary restart, let the system settle, and check again; this sometimes clears the problem, but did not.

The critical question now is whether the service which is crashing is within OS X, part of El Capitan, or some third-party software which might be old and broken. Unusually the logs were not giving any useful clues, so I restarted in Safe mode (with the Shift key held down). I was surprised at how long that took, and wonder whether El Capitan now runs more checks, and has further silent bells and whistles.

Again, I left my Mac a few minutes to let all the startup hullabaloo settle, then opened Console. Because you are in Safe mode, error reporting should now be more verbose, providing more info to help you track that cause. Sure enough launchd was still locked in its futile loop, but now the error messages revealed where the problem was arising: in the watchdog service, watchdogd. This is very much part of OS X, although it could be upset by third-party extensions or daemons.

elcapconsole2I then trudged through the usual culprits – the Extensions folders in /System/Library and /Library, the LaunchAgents and LaunchDaemons folders there, and StartupItems. Although there were some relatively old third-party items there, none seems to have affected these error messages.

Doing some housekeeping on extensions and daemons is never a bad thing. However in this case, I was not doing the simple but slightly obscure thing which solved the problem completely.

Although I do not normally run OS X Server, I keep a fully up-to-date copy on my Mac so that I can explore and use it when I wish (or need) to. The Mac App Store had dutifully updated the Server app for me on 21 September, to version 5.0.4, which it stated was ready for El Capitan. I had run the Server app after that update so that it could activate its components and services properly, then shut it down. However I had not run the Server app since I had upgraded to El Capitan.

The slightly obscure solution to my getting El Capitan to run clean was simply to start the Server app up. It refreshed its components and services, and suddenly my logs became much cleaner: no more looping through crashing services every 10 seconds.

Sometimes fixing problems in OS X requires a bit of inspired guesswork rather than the usual systematic approach.