From adaa62cf27fcacbc334fbd28a50e426ff065eceb Mon Sep 17 00:00:00 2001 From: Dimitrios Karagiannis Date: Tue, 1 Sep 2020 15:54:23 +0100 Subject: [PATCH] Add agent launchd instructions for OSX Signed-off-by: Dimitrios Karagiannis --- README.md | 29 +++++++++++++++++++++++++++++ contrib/uk.co.uw.wiresteward.plist | 22 ++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 contrib/uk.co.uw.wiresteward.plist diff --git a/README.md b/README.md index 10b6871..fc017b8 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ Table of Contents * [Install](#install) * [Try](#try) * [Running as systemd service](#running-as-systemd-service) + * [Running as launchd service (OSX)](#running-as-launchd-service-osx) * [Run](#run) * [Config](#config) * [Dev aws config - Example](#dev-aws-config---example) @@ -99,6 +100,34 @@ To look at it's logs: journalctl -u wiresteward.service ``` +### Running as launchd service (OSX) + +An example working service for launchd is described in +[uk.co.uw.wiresteward.plist](./contrib/uk.co.uw.wiresteward.plist). + +You need to copy the file under `/Library/LaunchDaemons/` and then set the +ownership to root: +``` +chown root:admin /Library/LaunchDaemons/uk.co.uw.wiresteward.plist +``` + +Finally, you need to load the service: +``` +sudo launchctl load /Library/LaunchDaemons/uk.co.uw.wiresteward.plist +``` + +This will allow the service to run as root, which is required to operate on the +network devices and routing table. + +Logs are stored in `/var/log/wirestward.log` as defined in the service file. To +view the logs you can simply: +``` +tail -f /var/log/wiresteward.log +``` + +You might want to setup log rotation as well if you find that the log file +grows too large. + ### Run The agent runs a local server on port 7773 and expects the user to visit diff --git a/contrib/uk.co.uw.wiresteward.plist b/contrib/uk.co.uw.wiresteward.plist new file mode 100644 index 0000000..07e9d9e --- /dev/null +++ b/contrib/uk.co.uw.wiresteward.plist @@ -0,0 +1,22 @@ + + + + + Label + uk.co.uw.wiresteward + KeepAlive + + RunAtLoad + + ProgramArguments + + /usr/local/bin/wiresteward + -agent + + + StandardErrorPath + /var/log/wiresteward.err.log + StandardOutPath + /var/log/wiresteward.log + +