From 653e1506adb9f1a4bc4da794c4a0c9eac0860c1c Mon Sep 17 00:00:00 2001 From: Adam Strzelecki Date: Wed, 13 Jan 2016 19:32:07 +0100 Subject: [PATCH] OS X launchd script Using this script: 1. Copy scripts/launchd/io.gogs.web.plist into /Library/LaunchDaemons 2. The script assumes Gogs is running under 'gogs' user and group, modify /Library/LaunchDaemons/io.gogs.web.plist if you want to user different user. 3. The script assumes Gogs is installed in /Users/git/gogs, modify /Library/LaunchDaemons/io.gogs.web.plist if you installed Gogs in different location. 4. Once you are sure that running Gogs manually via `gogs web` works fine, run it as a launchd service with: sudo launchctl load -F /Library/LaunchDaemons/io.gogs.web.plist From now on launchd will ensure Gogs is running, eg. when system is restarted. --- scripts/launchd/io.gogs.web.plist | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 scripts/launchd/io.gogs.web.plist diff --git a/scripts/launchd/io.gogs.web.plist b/scripts/launchd/io.gogs.web.plist new file mode 100644 index 000000000000..2a5ec7d6914f --- /dev/null +++ b/scripts/launchd/io.gogs.web.plist @@ -0,0 +1,39 @@ + + + + + Label + io.gogs.web + + + UserName + git + GroupName + git + ProgramArguments + + + + /Users/git/gogs/gogs + web + + RunAtLoad + + KeepAlive + + + + WorkingDirectory + /Users/git/gogs/ + StandardOutPath + /Users/git/gogs/log/stdout.log + StandardErrorPath + /Users/git/gogs/log/stderr.log + + SoftResourceLimits + + NumberOfFiles + 8192 + + +