Created
December 23, 2014 22:48
-
-
Save revis0r/28c979060a430c62c735 to your computer and use it in GitHub Desktop.
Bucardo init script, place in /etc/init.d/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: bucardo | |
# Required-Start: $remote_fs $syslog postgresql-9.3 | |
# Should-Start: postgresql-9.3 | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Manage bucardo | |
# Description: Start, stop, restart bucardo | |
### END INIT INFO | |
run () { | |
eval $1 | |
} | |
case "$1" in | |
start) | |
run "/usr/local/bin/bucardo --log-destination /var/log/bucardo start" | |
;; | |
stop) | |
run "/usr/local/bin/bucardo stop" | |
;; | |
force-stop) | |
run "/usr/local/bin/bucardo stop" | |
;; | |
restart|reload) | |
run "/usr/local/bin/bucardo --log-destination /var/log/bucardo restart" | |
;; | |
upgrade) | |
echo >&2 "Couldn't upgrade, starting '$CMD' instead" | |
run "/usr/local/bin/bucardo upgrade" | |
;; | |
reopen-logs) | |
echo >&2 "Not supported" | |
;; | |
*) | |
echo >&2 "Usage: $0 <start|stop|restart|upgrade|force-stop|reopen-logs>" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment