2 stable releases

1.0.1 Apr 15, 2024
1.0.0 May 7, 2020

#140 in macOS and iOS APIs

Download history 153/week @ 2025-12-06 115/week @ 2025-12-13 171/week @ 2025-12-20 134/week @ 2025-12-27 166/week @ 2026-01-03 162/week @ 2026-01-10 230/week @ 2026-01-17 239/week @ 2026-01-24 227/week @ 2026-01-31 143/week @ 2026-02-07 315/week @ 2026-02-14 188/week @ 2026-02-21 211/week @ 2026-02-28 592/week @ 2026-03-07 409/week @ 2026-03-14 458/week @ 2026-03-21

1,687 downloads per month
Used in 2 crates (via service-binding)

MIT/Apache

5KB
63 lines

Raunch

A safe wrapper around launchd launch_activate_socket.

#[cfg(target_os = "macos")]
let descriptors = raunch::activate_socket("socket-name").expect("activation to work");

The name of the socket (here socket-name) needs to match the socket name in the plist file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.example.agent</string>
	<key>OnDemand</key>
	<true/>
	<key>ProgramArguments</key>
	<array>
		<string>example-agent</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>Sockets</key>
	<dict>
		<key>socket-name</key>
		<dict>
			<key>SockPathName</key>
			<string>/Users/test/.openpgp-card-ssh-agent</string>
			<key>SockFamily</key>
			<string>Unix</string>
		</dict>
	</dict>
</dict>
</plist>

The file can be placed in ~/Library/LaunchAgents and loaded via launchctl load ~/Library/LaunchAgents/com.example.agent.plist.

Dependencies

~42KB