From 59c9dbe6a3e7caed435b13188cb42354ca577fb4 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 19 Jun 2019 13:18:34 +0200 Subject: wg-quick: darwin: support being called from launchd This causes wg-quick up to wait for the monitor to exit before it exits, so that launchd can correctly wait on it. Reported-by: Cameron Palmer --- contrib/examples/launchd/README | 12 ++++++++++++ contrib/examples/launchd/com.wireguard.wg0.plist | 25 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 contrib/examples/launchd/README create mode 100644 contrib/examples/launchd/com.wireguard.wg0.plist (limited to 'contrib') diff --git a/contrib/examples/launchd/README b/contrib/examples/launchd/README new file mode 100644 index 0000000..67f8d3c --- /dev/null +++ b/contrib/examples/launchd/README @@ -0,0 +1,12 @@ +WireGuard for Launchd +===================== + +The example `com.wireguard.wg0.plist` file may be used for running wg-quick(8) +as a launchd service. Note that the `PATH` variable is modified to point to +the PATH used by Homebrew or Macports, so that it uses the non-system bash(1). + +Usage +----- + +$ sudo cp com.wireguard.wg0.plist /Library/LaunchDaemons +$ sudo launchctl load /Library/LaunchDaemons/com.wireguard.wg0.plist diff --git a/contrib/examples/launchd/com.wireguard.wg0.plist b/contrib/examples/launchd/com.wireguard.wg0.plist new file mode 100644 index 0000000..9fc0141 --- /dev/null +++ b/contrib/examples/launchd/com.wireguard.wg0.plist @@ -0,0 +1,25 @@ + + + + + Label + com.wireguard.wg0 + ProgramArguments + + /usr/local/bin/wg-quick + up + /usr/local/etc/wireguard/wg0.conf + + OnDemand + + RunAtLoad + + TimeOut + 90 + EnvironmentVariables + + PATH + /usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin + + + -- cgit v1.2.3-59-g8ed1b