5

I created the configuration files in ~/Library/LaunchAgents

When I attempted to load the plist, I got the message that the service was already loaded.

launchctl load ~/LaunchAgents/hosts_Blocksites_AM.plist  
/Users/bryan/LaunchAgents/hosts_Blocksites_AM.plist: service already loaded  

When I attempted to find the Launchd agent nothing was returned.

$ sudo launchctl list | grep hosts_Blocksites_AM.plist

EDIT: fixed typo where I had:
launchctl load ~/LaunchAgents/hosts_unBlocksites_AM.plist

1
  • 1
    Try simplifying your grep statement and using the -i option in case you don't have the case correct (no pun intended): | grep -i blocksites
    – Allan
    Commented Aug 23, 2016 at 18:08

2 Answers 2

2

It's possibly because you grep'ed for a different file than you tried to load (hosts_unBlocksites_AM.plist vs. hosts_Blocksites_AM.plist), but also note that root has its own list of launch agents and when you run sudo launchctl list you will see root's list, which is different from launchctl list which will show yours.

So this should work (depending on what you're trying to do in your launch agent):

launchctl list | grep Blocksites
launchctl load ~/LaunchAgents/hosts_unBlocksites_AM.plist

If needed, run both as sudo (not just one of them).

2
  • That was a typo. I actually have hosts_unBlocksites_AM.plist and hosts_Blocksites_AM.plist Loaded with launchctl and neither show up in the: launchctl list | grep -i blocksites Commented Aug 23, 2016 at 21:49
  • 1
    Check what you used for the Label string in your plist file. This is the string that is printed from launchctl list. Assuming standard formatting of the plist file, then grep -A 1 Label ~/LaunchAgents/hosts_Blocksites_AM.plist will show the Label string you used.
    – woolfie
    Commented Aug 25, 2016 at 4:53
0

Take off the .plist.

$ sudo launchctl list | grep hosts_Blocksites_AM

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .