summaryrefslogtreecommitdiffstatshomepage
path: root/contrib
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-06-19 13:18:34 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2019-06-24 11:19:18 +0200
commit59c9dbe6a3e7caed435b13188cb42354ca577fb4 (patch)
tree04c02e6ad19eb2c55e00187ad6b01244022fddfb /contrib
parentqemu: show signal when failing (diff)
downloadwireguard-monolithic-historical-59c9dbe6a3e7caed435b13188cb42354ca577fb4.tar.xz
wireguard-monolithic-historical-59c9dbe6a3e7caed435b13188cb42354ca577fb4.zip
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 <cameron@promon.no>
Diffstat (limited to 'contrib')
-rw-r--r--contrib/examples/launchd/README12
-rw-r--r--contrib/examples/launchd/com.wireguard.wg0.plist25
2 files changed, 37 insertions, 0 deletions
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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>com.wireguard.wg0</string>
+ <key>ProgramArguments</key>
+ <array>
+ <string>/usr/local/bin/wg-quick</string>
+ <string>up</string>
+ <string>/usr/local/etc/wireguard/wg0.conf</string>
+ </array>
+ <key>OnDemand</key>
+ <false/>
+ <key>RunAtLoad</key>
+ <true/>
+ <key>TimeOut</key>
+ <integer>90</integer>
+ <key>EnvironmentVariables</key>
+ <dict>
+ <key>PATH</key>
+ <string>/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
+ </dict>
+</dict>
+</plist>