While trying to set up some services (OS X 10.10 Yosemite), I accidentally did a
sudo launchctl unload -w /System/Library/LaunchDaemons/ and the screen was frozen immediately. Now my Mac doesn't boot any more. The loading bar is half full, and nothing happens.
Is there a way to restore the daemons with some kind of rescue console? Unfortunately, I don't have a working time machine backup, my external hard drive crashed some days ago.
I can still boot into recovery mode, using Cmd+R while booting. I can also access the terminal. I tried a
launchctl load -w /System/Library/LaunchDaemons/ but it said ‘Operation already in progress’ for every process.
When trying to load the LaunchDaemons files, I was on the rescue partition. After switching to
/Volumes/Macintosh HD/System/Library/LaunchDaemons/ and doing a
launchctl load -w /Volumes/Macintosh HD/System/Library/LaunchDaemons/ I got some errors with
File already exists, but some other Daemons seem to load.
But I suspect, that they are loaded into the rescue system. So I also tried to use the launchctl file of
/Volumes/Macintosh HD/bin/launchctl. But unfortantely, same result, the screen stucks with a half progress bar during startup.
I had a look into the verbose startup (pressing Cmd+V at startup). The last lines, where everything stops are
hfs: mounted Macintosh HD on device root_device XCPM: registered VM Swap Subsystem is ON Darwin Bootstrapper Version 2.0.2: Mon Mar.... boot-args = -v ** /dev/rdisk1 (NO WRITE) ** Root file system Executing fsck_hfs (versoin hfs-285) Warning: couldn't block sleep during cache update Warning: proceeding w/o DiskArb /dev/disk1 on / (hfs, local, journaled) BootCacheControl: Unable to open /var/db/BootCache.playlist: 2 No such file or directory Bash: /etc/rc.server: No such file or directory USBMSC Identifier (non-unique): 0000000... bash: /etc/rc.installer_cleanup: No such file or directory AppleUSBMiltitouchDriver::checkStatus - received Status Packet, Payload 2: device was reinitialized
I also tried to reinstall Yosemite over my old system (without deleting the filesystem, so my data is still there). Unfortunately, the problem stays the same.
Now I can log in in single-user mode (I had to press an additional Enter). After that, I set the filesystem to read with
mount -uw /. Then I load all the daemons with
launchctl load -w /System/Library/LaunchDaemons. And then, surprise it loads my Mac's login screen, and I can login.
But when I try to restart, I have to repeat that step to login (which is kinda annoying…). I also tried to load all daemons with
launchctl load -w /System/Library/LaunchDaemons when I'm logged in.
Here I get ‘Operation already in progress’. I read something in the single-user mode that the loading of services is not supported. Does this affect the fully loaded OS X too? I'm not sure if I'm still in single-user mode or not. How can I tell OS X to load all the LaunchDaemons on startup?