Alex McFarlane

Useful Stuff

Removing Broken OSX Launch Daemons: net.juniper.AccessService

Start the console

open /Applications/Utilities/Console.app

Look at system.log reports. This can also be viewed by

syslog -w

My mac has a launch daemon running repeatedly in the background every 10s

Nov  7 15:32:15 iBanterMacBook com.apple.xpc.launchd[1] (net.juniper.AccessService[3276]): Service could not initialize: Unable to set current working directory. error = 2: No such file or directory, path = /Applications/Junos Pulse.app/Contents/Plugins/JUNS: 16B2555: xpcproxy + 11207 [1356][4A173B59-A786-3CBF-9740-CFC693060FEF]: 0x2
Nov  7 15:32:15 iBanterMacBook com.apple.xpc.launchd[1] (net.juniper.AccessService): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
Nov  7 15:32:25 iBanterMacBook com.apple.xpc.launchd[1] (net.juniper.AccessService[3277]): Service could not initialize: Unable to set current working directory. error = 2: No such file or directory, path = /Applications/Junos Pulse.app/Contents/Plugins/JUNS: 16B2555: xpcproxy + 11207 [1356][4A173B59-A786-3CBF-9740-CFC693060FEF]: 0x2
Nov  7 15:32:25 iBanterMacBook com.apple.xpc.launchd[1] (net.juniper.AccessService): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

I has uninstalled this program months previously. I finding the relevant launch daemon by

grep -lR juniper /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents/

where grep -lR juniper will search for all files in the following directories containing the pattern juniper

In this case the offenders were located at

/Library/LaunchDaemons/net.juniper.AccessService.plist
/Library/LaunchDaemons/net.juniper.UninstallPulse.plist
/Library/LaunchAgents/net.juniper.pulsetray.plist

I can then remove then by

GREP_NAME=juniper
for i in $(grep -lR $GREP_NAME /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents/);
    do sudo launchctl unload $i
    echo 'unloaded: ' $i
    sudo rm $i
    echo 'removed: '$i
done

you can check the launch daemons by invoking

sudo launchctl list | grep $GREP_NAME

If it still remains restart the system. Mine remained as I did not first unload the processes while writing. Restarting restarted launchd properly.