Skip to content

Instantly share code, notes, and snippets.

@marylly
Created June 24, 2018 20:24
Show Gist options
  • Save marylly/a29ce19c2e89562f5b8904e9aacd8f52 to your computer and use it in GitHub Desktop.
Save marylly/a29ce19c2e89562f5b8904e9aacd8f52 to your computer and use it in GitHub Desktop.
Consul OpenRC service
#!/sbin/openrc-run
depend() {
need localmount
after net
}
start() {
ebegin "Starting Consul"
start-stop-daemon --background --start --exec /go/bin/consul -- agent -server -config-file=/go/src/github.com/hashicorp/consul/consul.json
eend $?
}
stop() {
ebegin "Stopping Consul"
start-stop-daemon --stop --exec /go/bin/consul -- leave
eend $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment