Remove an agent from launchd

Mar 8, 2011 - 17 Comments

remove-launchd-service

The vast majority of Mac users won’t need to manually tweak launchd and launchctl, but there are times when you uninstall or stop using an app in Mac OS X and a service agent continues to needlessly load in launchd. This is annoying, but these rogue agents are easy to remove via the command line, so launch Terminal and away we go.

To remove a service from launchd, use the following syntax with the launchctl command:

launchctl remove name

For example, if I want to remove a service named “com.annoying.service” the syntax would be:

launchctl remove com.annoying.service

You may need to prefix the command with sudo in order to remove the service, in this case the command would be:

sudo launchctl remove com.annoying.service

You can also check what’s loaded into launchd by using:

launchctl list

This command lists all agents and jobs loaded into launchd, allowing you to easily manipulate the agents that are running.

Related articles:

Posted by: David Mendez in Command Line, Mac OS X

17 Comments

» Comments RSS Feed

  1. Magic says:

    I love the terminal tips, keep em comin

  2. Justin says:

    What are some of the services that we should remove? Any service that would be slowing down the computer?

  3. albinoz says:

    NIce tips thanks but remove result ” launchctl remove error: No such process” ?

  4. Tim says:

    OK, this has come at the perfect time for me. At least, I thought it had.

    Every time I rouse my Macbook from sleep, I get an annoying process named ‘rastertobrother3′. This seems to be a process related to the CUPS driver for Brother peripherals (which I don’t use).

    I kill the process manually because it uses 100MB of RAM which I can’t afford to lose. But doing it manually every time is a MASSIVE PAIN.

    Here’s where it gets weird: the process doesn’t show up in launchctd list. The process ID is simply not there.

    What the hell? How do I kill this process once and for all?!

  5. albinoz says:

    Tim : Look in /Library/LaunchAgent and /Library/LaunchDeamon or maybe in /Library/StartupItems. SomeTimes they are in your Home library… have more speed ;)

  6. Tim says:

    Hmm. No files in LaunchAgents. And I don’t have either of the other folders :(

  7. Christian says:

    OMG Thank You! I was finally able to remove this MYSQL service.

  8. Michael Hines says:

    This worked perfectly removing Xquartz from the list. I use the open source opennx client and one day I decided to try Xquarts instead of X11.app and suddenly my NX client stopped working. When I tried this to remove Xquartz, my NX started working again. You’re a lifesaver.

  9. golook says:

    Thanks for the tip but I am having a similar experience as Albinoz.
    I have services that start with my computer that are also found in the launchctl list but I get the error message ” launchctl remove error: No such process”
    Anybody got a clue?
    I even tried sudo with my password.
    I have multiple accounts on my computer but after a new start none have run. Besides I am the only admin!
    questions, question
    hope someone hears these late on comments

  10. Tom! says:

    amazing!, but I still have a problem,
    I uninstalled long ago MacKeeper, but I think I did it the wrong way, so, at the console still displaying this:

    25/03/12 14:30:51 com.apple.launchd[1] com.apple.launchd (com.zeobit.MacKeeper.plugin.AntiTheft.daemon[65237]) posix_spawn(“/Library/Application Support/MacKeeper/MacKeeperATd”, …): No such file or directory

    I want to get rid of this, i tried with all those comand lines, but nothing happens, what should i do?

    • helper says:

      You’ll have to track down the “com.zeobit.MacKeeper.plugin.AntiTheft.daemon” file, it’s probably in the /Library/LaunchDaemons/ directory

  11. Skip L says:

    Thanks Helper for the tip!
    Had the same MacKeeper launching services console problem;

    com.apple.launchd[1] com.apple.launchd (com.zeobit.MacKeeper.plugin.AntiTheft.daemon[65237]) posix_spawn(“/Library/Application Support/MacKeeper/MacKeeperATd”, …)

    deleted the .plst file under my user/Library/ LaunchAgents and finally got rid of the pesky issue!

  12. Frankly says:

    exactly the sort of answer that i absolutely hate about some Mac users below ..

    “What are some of the services that we should remove? Any service that would be slowing down the computer?

    None. If you don’t have a reason to, don’t mess around with launchd”

    - what a smug, unhelpful, narrow-minded and insulting answer.. that is exactly the sort of mindset that real tech’s hate. LaunchD is there to tweak, the whole OS is tweakable, so shitty answers like ‘apple knows best’ is exactly the type of blinkered and philistine answer that makes my blood boil.

    There is even a app called ‘Lingon’ – which lets you tweak, add, remove, respawn and generally mess around with Launchd.. there are many services n OS X that you can do without, consume RAM, CPU and thus battery life and with running additional unwanted ‘services’ or ‘daemons for example which can expose vulnerabilities on an network level.
    For example addressbook, podcast uploader, pictd, quicklook, remote desktop, screen reader, samba, cups, spindump, backupd, applespell, spindump and postfix are just some of the stuff not running on my MacbookPro .. i dont need, want or use them, so they can go.

    Just Google carefully the service you’re interested in, AND
    be prepared to reinstall if the Mac doesn’t start up after removing / disabling these, and obviously back up all your data BEFORE you do thid, or before you reinstall.
    Some you can remove easily and will never notice, some you may never use, and yes, some will kill the OS, making it unbootable again, requiring you to reinstall OSX again over the top of your broken OS.. warning over.

    Anti-intellectual, paternal and insulting comments llke
    ‘dont touch it’ are a disease in the Apple community and should be stamped out and these people should actually learn about computer operating systems themselves before opening their mouths.

    The info is out there,
    try it,
    reinstall it,
    learn it,
    understand it,
    and pass it on.

  13. Bob-O says:

    Any idea what launch puppies with “..anonymous..” in name are? See examples below (I’ve changed codes in case they’re revealing something about my system I don’t want known).

    Rather uncomfortable seeing such, like a virus or so.

    Some have process ID of launchd. There are several such in both sudo and user launchctl list.

    0x7f936fc058b0.anonymous.bash
    0x7f936ed2de90.anonymous.login

    Some have process IDs that aren’t listed in Activity Monitor.

    Several are attached to obvious processes, like

    0x7h035bd031d5.anonymous.WindowServer

    Thanks in advance

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

OSXDaily on Facebook

OSXDaily on Google+

Shop at Amazon

Ad

Shared on Facebook