Enabling/Disabling Launch Agents via Terminal
This is probably a great April Fools joke to play on somebody,
but I need an expert opinion on how badly I've just screwed my Mac.
I wanted to disable my notification center, so I hopped into Terminal. I thought, I'll just disable com.apple.notificationcenterui.plist!
Thus, I told to my Terminal,
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plistAll was going well, until I hit up to reload my last command, backspaced to disable another agent, but then accidentally hit enter:
launchctl unload -w /System/Library/LaunchAgents/Ooooooooops.
Terminal crashed, my desktop went black and all icons disappeared, the dock disappeared, and I was left with a solitary open Chrome browser window, and the top navigation bar. Clicking just about anything did nothing.
There was no finder. Downloading a file and clicking "Open in Finder" did nothing. I found that I could open the "downloads" folder in Chrome to view files, then click "Open location" and navigate through Chrome. Launching Terminal did nothing. I never did update to El Capitan, so I downloaded it through Chrome thinking if I installed the update I'd get my launch agents back. But, clicking to run any .dmg file did nothing.
So I turned the machine off, rebooted with command+R and launched Terminal that way. I figured I could just reload my launch agents with the reverse command:
launchctl load -w /System/Library/LaunchAgents/But this is what I got back instead. "Service cannot load in requested session" for many agents. However, after rebooting the machine after this command, my desktop is back, my dock is back, and everything appears to be functioning correctly... Are there further steps I need to take to re-enable these other agents, or are they fine?
Nicholass-MacBook-Pro:~ NChimonas$ launchctl load -w /System/Library/LaunchAgents
/System/Library/LaunchAgents/com.apple.cvmsCompAgentLegacy_i386.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.mdworker.lsb.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.sbd.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.secinitd.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.security.cloudkeychainproxy.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.speech.speechsynthesisd.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.syncdefaultsd.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.cvmsCompAgent_i386.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.cvmsCompAgent_x86_64_1.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.cvmsCompAgentLegacy_x86_64_1.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.mbloginhelper.user.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.pluginkit.pkd.plist: File exists
/System/Library/LaunchAgents/com.apple.secd.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.cvmsCompAgent_x86_64.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.distnoted.xpc.agent.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.FileSyncAgent.PHD.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.mdworker.shared.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.metadata.mdflagwriter.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.UserNotificationCenterAgent-LoginWindow.p list: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.mdworker.32bit.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.cfprefsd.xpc.agent.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.cvmsCompAgent_i386_1.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.cvmsCompAgentLegacy_x86_64.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.mdworker.mail.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.mdworker.single.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.TrustEvaluationAgent.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.UserEventAgent-LoginWindow.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.mdworker.bundles.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.mdworker.sizing.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.netauth.user.auth.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.xmigrationhelper.user.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.AppleGraphicsWarning.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.cvmsCompAgentLegacy_i386_1.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.mbpluginhost.user.plist: File exists
/System/Library/LaunchAgents/com.apple.mdworker.isolation.plist: Service cannot load in requested session
/System/Library/LaunchAgents/com.apple.tccd.plist: Service cannot load in requested session
Nicholass-MacBook-Pro:~ NChimonas$ launchctl load -w /System/Library/LaunchAgents
[Restored]
Last login: Fri Apr 1 14:14:39 on console
MacBook Pro (Retina, 15-inch, Mid 2014), OS X Yosemite (10.10.5), Terminal Fun!