macOS Prevent Cisco AnyConnect from Automatically Start

2024年02月14日


Search for any Cisco AnyConnect related items.
% launchctl list | awk 'NR==1 || /anyconnect/'

PID	Status	Label
-	255	com.cisco.anyconnect.aciseposture
674	0	application.com.cisco.anyconnect.gui.8965410.8965415
545	0	com.cisco.anyconnect.gui
-	0	com.cisco.anyconnect.notification

NOTE
In macOS, when you execute the launchctl list command, it provides a list of services and agents managed by launchd, the system and service manager in macOS. This command outputs several columns of information for each item, including "PID" (Process Identifier) and "Status". Here's what they mean:

PID (Process Identifier): The PID is a unique number assigned by the operating system to each running process. This identifier is used to reference the process in various system-level operations. In the context of launchctl list, if a service or agent is currently running, its PID will be displayed in the PID column. If the service or agent is not running, you will see a "-" in this column, indicating that there is no active process associated with that item.

Status: The Status field shows the exit status of the process the last time it was run. This is particularly useful for debugging or monitoring purposes, as it can indicate whether the service or agent exited normally or with an error. A status of 0 typically means that the process exited successfully without any errors. A non-zero status indicates an error or abnormal termination, with different numbers providing insight into the nature of the error based on the specific conventions of the application or the system.
  • A positive status code usually represents a custom exit code specified by the application.
  • A negative status code often represents a signal number that caused the process to terminate. For example, -9 would indicate the process was killed with SIGKILL (signal 9).

Understanding the PID and Status can help with managing and troubleshooting services and background processes on macOS, as it provides insight into which processes are currently running and whether they've encountered any issues upon their last execution.

% launchctl list com.cisco.anyconnect.gui
{
	"LimitLoadToSessionType" = "Aqua";
	"Label" = "com.cisco.anyconnect.gui";
	"OnDemand" = true;
	"LastExitStatus" = 0;
	"Program" = "open";
	"ProgramArguments" = (
		"open";
		"--wait-apps";
		"/Applications/Cisco/Cisco AnyConnect Secure Mobility Client.app";
	);
};
If you find any, you can remove them using the launchctl remove <label> command, where <label> is the label of the Cisco AnyConnect item found in the list.

% launchctl unload -w /Library/LaunchAgents/com.cisco.anyconnect.gui.plist

% launchctl list | awk 'NR==1 || /anyconnect/'
PID	Status	Label
-	255	com.cisco.anyconnect.aciseposture
-	0	com.cisco.anyconnect.notification

% ls /Library/LaunchAgents/com.cisco.anyconnect.gui.plist
/Library/LaunchAgents/com.cisco.anyconnect.gui.plist


References


Stop Cisco AnyConnect Secure Mobility Client from starting up automatically



Category: macOS Tags: public

Upvote


Downvote