How to PERMANENTLY kill an activity/process?

Discussion in 'OS X Mountain Lion (10.8)' started by ABDacome, Apr 17, 2013.

  1. macrumors newbie

    Joined:
    Apr 17, 2013
    #1
    Hello all,

    So I have been having trouble with iMessage, and I already tried everything I could find, until ONE solution worked...
    Every time I would try to log in to iMessage, it will APPEAR to work, but the " Enable" part never verfies...
    Screen Shot 2013-04-17 at 8.29.28 PM.png

    A moment later, it returns with this error message:
    Screen Shot 2013-04-17 at 8.29.18 PM.png

    After hours of trying to resolve this problem, I found ONE solution that works, and what I have to do is kill a process called "imagent" in Activity Monitor:
    Screen Shot 2013-04-17 at 8.32.28 PM.png

    After I quit that process, I log in to iMessage ( very quickly ) and it works, enabling the account...

    ... Until the process "imagent" starts up again, causing iMessage to return with the same error message as earlier, logging me out.

    Does anyone know how to permanently make a process stop running ? It would help me so much.

    Thank you!
     
  2. macrumors 603

    justperry

    #2
    I tell you only because you want it to stop, it probably won't hurt the System but as always keep a backup.

    The file to move is /System/Library/LaunchAgents/com.apple.imagent.plist
    If you do it this way you have to restart, however you also could unload the process with terminal like this:

    sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.imagent.plist
     
  3. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #3
    justperry, so do I delete that file, or can I simply just move it to the desktop ? I feel like if I delete it, it will just re-create in the folder.
     
  4. macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #4
    Yes, you can move it to the desktop or delete it. It will not automatically re-create it in the LaunchAgents folder on restart.
     
  5. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #5
    I navigated to the specified folder, and there was no such file there ):
    Screen Shot 2013-04-17 at 8.48.10 PM.png

    So I tried pasting --

    sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.imagent.plist

    into the terminal, the first time around, it asked for my password, so I entered it in, and it tells me there is an error removing the file... is that because it is not there ?
    Screen Shot 2013-04-17 at 8.48.37 PM.png

    However, When I open up Activity Monitor, there is imagent, just mocking me ):
     
  6. macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #6
    Your Library folders are hidden by default in Lion and ML. To get to your /Library or /Users/yourusername/Library (also known as the ~/Library) folders in Lion and ML:
    • Launch Finder and click Go > Go to Folder and type: /Library or ~/Library
    • Hold the Option key while clicking the Go menu item, which reveals your ~/Library folder in the menu.


    Check the following locations for imagent or any other apps/processes that automatically launch on startup and delete any you don't need/want:
    • System Preferences > Accounts > yourusername > Login Items
      (Lion and ML users: System Preferences > Users & Groups > yourusername > Login Items)

    • /Library/LaunchAgents/
      (Lion and ML users: In Finder, click Go > Go to Folder > then enter the path above)

    • ~/Library/LaunchAgents/
      (Lion and ML users: In Finder, click Go > Go to Folder > then enter the path above)

    • /Library/StartupItems/
      (Lion and ML users: In Finder, click Go > Go to Folder > then enter the path above)
     
  7. macrumors 603

    justperry

    #7
    Do not ever delete System Files, you can move that file to /System/Library and leave it there.
    I prefer to move the file instead of unloading it, reason is you can still see the file so you remember you moved it while if you unload it there is no visible way to see if it is disabled.

    If you want to move the file you need root access, the easiest way is with Terminal, here it is.

    sudo mv /System/Library/LaunchAgents/com.apple.imagent.plist /System/Library
    Hit Enter
    Enter Password

    Do NOT move that Folder, if you do sos your System will almost sure not startup, only move the above file, restart after.

    Again, always have a bootable backup if you do anything like this, if you mess up it is easily undone by booting from another disk.
     
  8. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #8


    • That's what I tried the first time around, opening Finder, Holding down option, and clicking Library, navigating to the Launch Folder, and only two files are there...
      View attachment 408360

      should I give my system a reboot, try your suggestion once more, and see if the file appears ? I don't know why it would do that, but I guess it's worth a try. Unless there is another option I could try, that would be very helpful
     
  9. macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #9
    Restarting is certainly a good option.
     
  10. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #10

    I entered the command for root access into terminal, navigated back to the folder, and still only two files appear. I never moved the file or deleted it beforehand, it's just not there for some reason

    ----------

    Okay, will give it a reboot and get back to you guys on that.
     
  11. macrumors 603

    justperry

    #11
    The LaunchAgent you are looking for is in the Folder I mentioned above, it is not in GGJStudios Folders.

    It is here: /System/Library/LaunchAgents/com.apple.imagent.plist

    Try again with:

    sudo launchctl unload -w /System/Library/LaunchAgents/com.apple.imagent.plist
     
  12. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #12
    I found that file in Library>Preferences its titled com.apple.imagent.plist ...

    if I move that file into LaunchAgents, and then use the terminal command to unload it, will that work ?
     
  13. macrumors 603

    justperry

    #13
    No, this has nothing to do with it, I have one in my Home Preferences Folder as well.

    Enter the following commands in Terminal and see if it is there

    cd /System/Library/LaunchAgents
    Hit Enter
    ls
    Hit Enter

    Is it there?
     
  14. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #14
    I opened the file that was in preferences to take a look at what was inside and i accidentally hit a key on my keyboard, editing the string inside com.apple.imagent.plist and now my messages app will not launch... are all of the files on all macs the same ? if so, can you copy and paste the contents of yours so I can fix that ?
     
  15. justperry, Apr 17, 2013
    Last edited: Apr 17, 2013

    macrumors 603

    justperry

    #15
    I told you before to have a backup, if you don't do so you can into troubles like this, if you don't heed warnings you will mess up one day.

    If the File was in /Users/yourname/Library/Preferences you can safely delete it since it should not interfere, I think the problem is ImAgent just crashes because the file is unreadable.
    Only delete the file if it is there.

    plist files are personal preference files and are almost always different on other Macs.

    Edit: You did not answer my last question in my last post.

    cd /System/Library/LaunchAgents
    Hit Enter
    ls
    Hit Enter

    Is it there?
     
  16. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #16
    Just like this ?
    Screen Shot 2013-04-17 at 10.17.32 PM.png
     
  17. macrumors 603

    justperry

    #17
    It's wrong, it is LS from LIST but not capitalised, so ls

    Copy and paste is always better than just entering text, that's why I think you had the command wrong before as well.
     
  18. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #18
    Ah, I thought you posted "is" okay, will retry that
     
  19. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #19
    I don't see com.apple.imagent.plist in this list, although it should be somewhere in the highlighted area.
    Screen Shot 2013-04-17 at 10.37.07 PM.png
     
  20. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #20
    I just installed ML yesterday, so doing a clean install shouldn't be a problem. I'm going to try that, if the problem persists, I will try all the above instructions again. At first, simply quitting the activity did the trick.

    Thanks!
     
  21. macrumors 603

    justperry

    #21
    I wanted to ask you before but slipped my mind, what OS X version you are running, Mountain Lion or Lion or even earlier?
    Look at mine, plenty more than yours and I am on Mountain Lion.

    Edit: I wrote this while you posted again.
     

    Attached Files:

  22. thread starter macrumors newbie

    Joined:
    Apr 17, 2013
    #22

    I was running OS X 10.8.3. Now that I did a clean install, I'm back at 10.8, downloading combo update now. iMessage still gives me the same error, wil enter that last command into terminal though

    ----------

    And wouldn't you know it, there it is...

    View attachment 408384

    now, what is my next step to take ?
     

Share This Page