Raunch
A safe wrapper around launchd launch_activate_socket.
let descriptors = activate_socket.expect;
The name of the socket (here socket-name) needs to match the socket name in the plist file:
Label
com.example.agent
OnDemand
ProgramArguments
example-agent
RunAtLoad
Sockets
socket-name
SockPathName
/Users/test/.openpgp-card-ssh-agent
SockFamily
Unix
The file can be placed in ~/Library/LaunchAgents and loaded via launchctl load ~/Library/LaunchAgents/com.example.agent.plist.