launchd – The best way to change a system startup daemon right into a consumer launch agent

0
19
launchd – The best way to change a system startup daemon right into a consumer launch agent


I am utilizing The Pritunl VPN software program for considered one of my Mac’s consumer accounts. The software program installer creates a system LaunchDaemon discovered underneath /Library/LaunchDaemons referred to as com.pritunl.service.plist

Sadly this service stays energetic after I sign off from the consumer profile it is supposed for, inflicting the VPN connection to additionally stay energetic for various consumer accounts.

What I wish to do is to take away this service from the /system/ and add it as a /consumer/username startup service. My intention is for the service to be began every time I log in with the particular consumer and for it to cease every time the consumer is logged out.

What I’ve tried to take action far is to unload the system service, take away the .plist from the system listing /Library/LaunchDaemons and to maneuver it to the consumer listing ~/Library/LaunchAgents after which I tried loading and registering it for the particular consumer account. I’ve not but succeeded in performing these steps accurately because the consumer account in query doesn’t have root entry.





    Label
    com.pritunl.service
    ProgramArguments
    
        /Purposes/Pritunl.app/Contents/Sources/pritunl-service
    
    KeepAlive
    
    Umask
    0


sudo launchctl checklist com.pritunl.service
{
    "LimitLoadToSessionType" = "System";
    "Label" = "com.pritunl.service";
    "OnDemand" = false;
    "LastExitStatus" = 0;
    "PID" = XXXX;
    "Program" = "/Purposes/Pritunl.app/Contents/Sources/pritunl-service";
    "ProgramArguments" = (
        "/Purposes/Pritunl.app/Contents/Sources/pritunl-service";
    );
};

Reference materials I’ve used: https://rakhesh.com/mac/macos-launchctl-commands/

When making an attempt to study extra about LimitLoadToSessionType I’ve solely managed to seek out this archived older documentation.
https://developer.apple.com/library/archive/technotes/tn2083/_index.html

Looking for it on the present documentation web page hasn’t resulted in what I am on the lookout for. https://developer.apple.com/search/?q=LimitLoadToSessionType

I’ve discovered this wonderful put up detailing a variety of associated topics. launchd: Confusion on semantics of bootstrap and bootout and so forth. after studying guide pages

LEAVE A REPLY

Please enter your comment!
Please enter your name here