Skip to content

Instantly share code, notes, and snippets.

@bebrws
Last active April 27, 2023 17:29
Show Gist options
  • Save bebrws/b1cf3e3052b1948074dfb08c4d391ed8 to your computer and use it in GitHub Desktop.
Save bebrws/b1cf3e3052b1948074dfb08c4d391ed8 to your computer and use it in GitHub Desktop.
An OSX LaunchAgent plist file for starting sourcegraph on startup. Useful if your running a local sourcegraph instance on an extra Mac
<?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>dev.bbarrows.sourcegraph-local-server</string>
<key>ServiceDescription</key>
<string>Start the sorucegraph service on boot</string>
<key>Program</key>
<string>/usr/local/bin/sourcegraph</string>
<key>StandardErrorPath</key>
<string>/opt/sg/sg-error.log</string>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
</string>
</dict>
<key>RunAtLoad</key>
<true />
</dict>
</plist>
<!-- Some commands to run if you want logging and all like I did: -->
<!-- sudo mkdir -p /opt/sg -->
<!-- sudo chown `whoami`:staff /opt/sg -->
<!-- -->
<!-- Now put this plist file here into place so it gets loaded on startup: -->
<!-- sudo mv sourcegraph.plist /Library/LaunchAgents/ -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment