How to Cleanly Remove Old Juniper Pulse Installation from macOS

launchdmacos

The Console application on the Mac is continuously throwing log messages presumably because fragments of a previous install are still in place. I have tried Googling around for a solution and using grep to search through plist files for obvious strings. No luck so far.

Getting recurring error messages per the below:

May 26 19:12:53 MacBook-Pro com.apple.xpc.launchd[1] (net.juniper.AccessService[73727]): 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: 16G2136: xpcproxy + 11215 [1386][C3C8A771-3847-30E4-BE12-7941C4A2924D]: 0x2
May 26 19:12:53 MacBook-Pro com.apple.xpc.launchd[1] (net.juniper.AccessService): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.

Best Answer

First you will have to locate where Juniper installed the net.juniper.AccessService daemon.

Here is a shell script made without a real case to test it (in blind mode), then beware of any errors and report them in comments so I will be able to fix it.

_plist1="net.juniper.AccessService.plist"
_plist2="net.juniper.UninstallPulse.plist"

export _plist1 _plist2

for _dir in /Library/LaunchDaemons /System/Library/LaunchDaemons ; do
    cd ${_dir}

    # check if the .plist is in this directory

    if [ -f ${_plist1} -o -f ${_plist2} ] ; then
        echo "found in ${_dir}"
        launchctl unload -w ${_plist1}
        launchctl unload -w ${_plist2}
        rm -i ${_plist1} ${_plist2}
    fi
done
  1. Run this script without root priviledges. Check that the echo display the plist file is found in one of the 2 directories and the launchctl command issue an error because you don't have priviledge to stop this daemon.

  2. If you didn't get any unexpected error message, then

    switch to root user:

    /usr/bin/sudo -s
    

    run this small script once more and answer y to the rm command to definetely remove the Juiper daemon.

    Then exit root user:

    exit