macos – What’s the correct approach to cease and restart a service that may be a “bundled daemon”?


There are some latest apps, e.g., Cisco Safe Shopper / AnyConnect VPN service, the place the service can’t be stopped/began utilizing the LaunchControl.app.

For extra management over what’s working on the machine and when, I would really like to have the ability to cease/begin the service utilizing the command line and be sure that it’s loaded correctly by checking its state utilizing applicable instructions.

Nevertheless, the tactic I’ve to cease the service leads to me not having the ability to question the service standing after I begin the service again up.
What’s the correct approach to cease/begin providers for “bundled providers” ??

To start out, I examine whether or not the service is working on or not:

$ launchctl print system/com.cisco.secureclient.vpn.service.agent
system/com.cisco.secureclient.vpn.service.agent = {
    energetic depend = 1
    path = (submitted by smd.303)
    kind = Submitted
    managed_by = com.apple.xpc.ServiceManagement
    state = working

    program identifier = Contents/MacOS/vpnagentd (mode: 2)
    dad or mum bundle identifier = com.cisco.secureclient.vpn.service
    BTM uuid = 61DCA467-D6AD-4251-90D7-E49891CEAE80
    arguments = {
        vpnagentd
        -execv_instance
    }

    default surroundings = {
        PATH => /usr/bin:/bin:/usr/sbin:/sbin
    }

    surroundings = {
        XPC_SERVICE_NAME => com.cisco.secureclient.vpn.service.agent
    }

    area = system
    minimal runtime = 10
    exit timeout = 45
    runs = 2
    pid = 1987
    fast cause = inefficient
    forks = 5
    execs = 1
    initialized = 1
    trampolined = 1
    began suspended = 0
    proxy began suspended = 0
    final exit code = 0

    spawn kind = daemon (3)
    jetsam precedence = 40
    jetsam reminiscence restrict (energetic) = (limitless)
    jetsam reminiscence restrict (inactive) = (limitless)
    jetsamproperties class = daemon
    submitted job. ignore execute allowed
    jetsam thread restrict = 32
    cpumon = default
    job state = working
    probabilistic guard malloc coverage = {
        activation charge = 1/1000
        pattern charge = 1/0
    }

    properties = partial import | keepalive | abandon course of group | resolve program | has LWCR

I can cease this service utilizing the next command:

sudo launchctl bootout system/com.cisco.secureclient.vpn.service.agent

Nevertheless, after I do this, I can’t re-load the service again once more to a state that’s recognizable by LaunchControl, neither is it listed in launchctl print system/com.cisco.secureclient.vpn.service.agent

$ launchctl print system/com.cisco.secureclient.vpn.service.agent
Unhealthy request.
Couldn't discover service "com.cisco.secureclient.vpn.service.agent" in area for system

service

error message

unloaded

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *