Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

launchctl: Error unloading

OSX 10.9.2


I have a launch agent “audaemon” that I can’t unload:


% ps aux | grep audaemon

carl 281 0.0 0.1 2541164 8788 ?? S Fri03PM 0:06.02 /Users/carl/Applications/audaemon


% launchctl unload /Users/carl/Library/LaunchAgents/com.mycom.audaemon.plist

launchctl: Error unloading: com.mycom.audaemon


Nothing shows up in the Console logs.


The contents of the plist (which has always worked before, and is unmodified):


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>OnDemand</key>

<false/>

<key>Label</key>

<string>com.mycom.audaemon</string>

<key>ProgramArguments</key>

<array>

<string>/Users/carl/Applications/audaemon</string>

</array>

</dict>

</plist>


Running "lint" on it shows nothing wrong:


% plutil -lint /Users/carl/Library/LaunchAgents/com.mycom.audaemon.plist

/Users/carl/Library/LaunchAgents/com.mycom.audaemon.plist: OK


Additionally I’ve deleted /var/db/launchd.db/com.apple.launchd/overrides.plist, even though there wasn’t much in it. Still no go.

What am I overlooking?

iMac, Mac OS X (10.7.5)

Posted on Apr 8, 2014 12:30 PM

Reply
11 replies

Apr 8, 2014 5:28 PM in response to Linc Davis

I moved the binary and killed the process. launchd doesn't restart it.


4/8/14 5:17:40.498 PM com.apple.launchd.peruser.501[167]: (com.mycom.audaemon[2616]) Exited: Terminated: 15

4/8/14 5:17:40.499 PM com.apple.launchd.peruser.501[167]: (com.mycom.audaemon[2679]) Job failed to exec(3). Setting up event to tell us when to try again: 2: No such file or directory

4/8/14 5:17:40.499 PM com.apple.launchd.peruser.501[167]: (com.mycom.audaemon[2679]) Job failed to exec(3) for weird reason: 2


I moved the binary back, and launchd restarts it.


carl 2684 0.0 0.1 2532976 8440 ?? S 5:26PM 0:00.04 0:13.42 /Users/carl/Applications/audaemon


So, I think it's saying that it is the very same agent.

Apr 9, 2014 11:47 AM in response to Linc Davis

Okay, this is getting somewhere...


I removed the plist and logged out and back in. The process is gone.

However if I place the plist back in ~/Library/LaunchAgents/ it does not restart when logging in again.


At the Terminal window, if I try to


launchctl load /Users/carl/Library/LaunchAgents/com.mycom.audaemon.plist

nothing found to load


But it loads only if I supply the -F option (which I can't do when logging in).


I checked the overrides.plist, and there's only 1 entry in it (smbd):


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>com.apple.smbd</key>

<dict>

<key>Disabled</key>

<true/>

</dict>

</dict>

</plist>


Any ideas as to why I would now need the -F option to load it?

Apr 9, 2014 2:01 PM in response to Linc Davis

> There is a per-user overrides file


Indeed! I found it: /var/db/launchd.db/com.apple.launchd.peruser.521/overrides.plist


<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

<plist version="1.0">

<dict>

<key>com.mycom.audaemon</key>

<dict>

<key>Disabled</key>

<true/>

</dict>

</dict>

</plist>


The -w option does reset the Disabled key to false, but I deleted the file anyways, and now it works as expected! (I do wish launchctl were more verbose.)


Thanks for the great help!

launchctl: Error unloading

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.