This discussion is locked
Valentin Starke

Q: How to remove service from launchd using launchctl

Hello ... I have removed an application called "Internet Everywhere" and noticed that my computer at start-up tried to launch this service anyways. Using console I identified that launchd access the file ˜/library/LaunchAgents/Internet Everywhere (there is a space between these words). Internet Everywhere appears as a service with status "1" in launchctl list.

I tried to initially using launchctl remove "Internet Everywhere" and the answer was that there was no such service. The I tried using launchctl unload and still no success:

MacBookProCV:~ valentin$ sudo launchctl unload /Users/valentin/Library/LaunchAgents/"Internet Everywhere"
launchctl: Dubious ownership on file (skipping): /Users/valentin/Library/LaunchAgents/Internet Everywhere
nothing found to unload

I guess I am overlooking something. Can you help me understanding what I have to do to remove this service?


Best regards

Valentin.

MacBook Pro late-2007, Mac OS X (10.5.6), iSight, Airport Express, MacBook

Posted on Jan 19, 2009 5:23 AM

Close

Q: How to remove service from launchd using launchctl

  • All replies
  • Helpful answers

  • by KJK555,

    KJK555 KJK555 Jan 19, 2009 5:58 AM in response to Valentin Starke
    Level 4 (2,895 points)
    Jan 19, 2009 5:58 AM in response to Valentin Starke
    Remove the plist file.

    FILES
    ~/Library/LaunchAgents #Per-user agents provided by the user.#
    /Library/LaunchAgents # Per-user agents provided by the administrator#
    /Library/LaunchDaemons #System wide daemons provided by the administrator#
    /System/Library/LaunchAgents #Mac OS X Per-user agents.#
    /System/Library/LaunchDaemons #Mac OS X System wide daemons.#

    most likely located in ~/Library/LaunchAgents.

    Kj
  • by Valentin Starke,

    Valentin Starke Valentin Starke Jan 19, 2009 7:13 AM in response to KJK555
    Level 1 (40 points)
    Jan 19, 2009 7:13 AM in response to KJK555
    Thank you for taking the time to write me. I had come across the description of the folders in the man for launchctl. In my original post I had written that I had located the file in precisely ~/Library/LaunchAgents. Other then just deleting it do you know how to use the unload or remove command in launchctl for "Internet Everywhere"?


    Best regards

    Valentin.
  • by Barney-15E,Solvedanswer

    Barney-15E Barney-15E Jan 19, 2009 7:54 AM in response to Valentin Starke
    Level 9 (50,647 points)
    Mac OS X
    Jan 19, 2009 7:54 AM in response to Valentin Starke
    Because it is in the LaunchAgents folder, the only thing you need to do is remove the folder in LaunchAgents folder. Launchd launches those items on log in. There is nothing to unload because it fails to load since the file cannot be found.
  • by V.K.,Helpful

    V.K. V.K. Jan 19, 2009 8:17 AM in response to Valentin Starke
    Level 9 (56,110 points)
    Jan 19, 2009 8:17 AM in response to Valentin Starke
    a launch daemon should normally have a .plist extension. did you skip it? that would explain why the command gives an error.
    the command you are using is basically correct. you don't need sudo because the daemon is in your home directory. also, to unload it so that it doesn't load automatically on the next login you should use -w switch. this will add a 'disabled' flag to the daemon. the syntax is

    launchctl unload -w /path/to/daemon

    However, as others have said the best thing is to trash the daemon and log out/in. you don't need it for anything as you've removed the application that created it.
  • by Topher Kessler,Helpful

    Topher Kessler Topher Kessler Jan 19, 2009 8:19 AM in response to Valentin Starke
    Level 6 (9,866 points)
    Jan 19, 2009 8:19 AM in response to Valentin Starke
    Launchd can load files that are NOT in the launch daemons or launch agents folders. To unload the file, you will need to know the path to the .plist file (can be in an application, or in another folder). Then you'l need to run the launchctl unload command as such:

    sudo launchctl unload -w /path/to/daemon.plist


    Having the files in those folders just enables automatic launching of them.

    Message was edited by: Topher Kessler
  • by Topher Kessler,

    Topher Kessler Topher Kessler Jan 19, 2009 8:20 AM in response to V.K.
    Level 6 (9,866 points)
    Jan 19, 2009 8:20 AM in response to V.K.
    sigh....
  • by V.K.,

    V.K. V.K. Jan 19, 2009 8:22 AM in response to Topher Kessler
    Level 9 (56,110 points)
    Jan 19, 2009 8:22 AM in response to Topher Kessler
    he-he.
  • by Valentin Starke,

    Valentin Starke Valentin Starke Jan 20, 2009 1:56 AM in response to Valentin Starke
    Level 1 (40 points)
    Jan 20, 2009 1:56 AM in response to Valentin Starke
    Launchctl is not necessary for daemons installed in the auto-launch directories. Simple removal is sufficient. See manual for launchctl provided by apple for details of the directories.
  • by Bal Snow,

    Bal Snow Bal Snow Feb 8, 2009 4:12 PM in response to Valentin Starke
    Level 1 (5 points)
    Feb 8, 2009 4:12 PM in response to Valentin Starke
    I also have an issue with a launchd file. I"m getting this"
    2/8/09 6:22:22 PM com.apple.launchd[237] (com.carbonite.carbonitestatus[2079]) Exited with exit code: 1
    2/8/09 6:22:22 PM com.apple.launchd[237] (com.carbonite.carbonitestatus) Throttling respawn: Will start in 10 seconds
    2/8/09 6:22:32 PM com.apple.launchd[237] (com.carbonite.carbonitestatus[2080]) posix_spawnp("/Library/Application Support/Carbonite/CarboniteStatus.app/Contents/MacOS/CarboniteStatus", ...): No such file or directory

    I deleted all the carbonite plist I could find. What am I missing?
  • by V.K.,

    V.K. V.K. Feb 8, 2009 4:17 PM in response to Bal Snow
    Level 9 (56,110 points)
    Feb 8, 2009 4:17 PM in response to Bal Snow
    please start your own thread and someone will help you.