diff --git a/debian/repmgr.repmgrd.default b/debian/repmgr.repmgrd.default index c966e7ca..1eb55921 100644 --- a/debian/repmgr.repmgrd.default +++ b/debian/repmgr.repmgrd.default @@ -1,18 +1,18 @@ -#!/bin/sh -# default settings for repmgrd. This file is source by /bin/sh from -# /etc/init.d/repmgrd - -# disable repmgrd by default so it won't get started upon installation -# valid values: yes/no -REPMGRD_ENABLED=no - -# Options for repmgrd -REPMGRD_OPTS="" - -# repmgrd binary -REPMGR_BIN="/usr/bin/repmgr" - -# pid file -REPMGR_PIDFILE="/var/run/repmgrd.pid" - - +#!/bin/sh +# default settings for repmgrd. This file is source by /bin/sh from +# /etc/init.d/repmgrd + +# disable repmgrd by default so it won't get started upon installation +# valid values: yes/no +REPMGRD_ENABLED=no + +# Options for repmgrd +REPMGRD_OPTS="" + +# repmgrd binary +REPMGR_BIN="/usr/bin/repmgr" + +# pid file +REPMGR_PIDFILE="/var/run/repmgrd.pid" + + diff --git a/debian/repmgr.repmgrd.init b/debian/repmgr.repmgrd.init index 3ee82e50..2473c2c9 100644 --- a/debian/repmgr.repmgrd.init +++ b/debian/repmgr.repmgrd.init @@ -1,54 +1,54 @@ -#!/bin/sh -### BEGIN INIT INFO -# Provides: repmgrd -# Required-Start: $local_fs $remote_fs $network $syslog $postgresql -# Required-Stop: $local_fs $remote_fs $network $syslog $postgresql -# Should-Start: $syslog $postgresql -# Should-Start: $syslog $postgresql -# Default-Start: 2 3 4 5 -# Default-Stop: 0 1 6 -# Short-Description: Start/stop repmgrd -### END INIT INFO - -set -e - -if test -f /etc/default/repmgrd; then - . /etc/default/repmgrd -fi - -if [ -z "$REPMGRD_BIN" ]; then - REPMGRD_BIN="/usr/bin/repmgrd" -fi - -if [ -z "$REPMGRD_PIDFILE" ]; then - REPMGRD_PIDFILE="/var/run/repmgrd.pid" -fi - -test -x $REPMGRD_BIN || exit 0 - -case "$REPMGRD_ENABLE" in - [Nn]*) - exit 0 - ;; -esac - -case "$1" in - start) - start-stop-daemon --start --quiet --make-pidfile --pidfile $REPMGRD_PIDFILE --exec $REPMGRD_BIN $REPMGRD_OPTS - ;; - - stop) - start-stop-daemon --stop --oknodo --quiet --pidfile $REPMGRD_PIDFILE - ;; - - restart) - $0 stop && $0 start || exit 1 - ;; - - *) - echo "Usage: $0 {start|stop|restart}" - exit 1 - ;; -esac - -exit 0 +#!/bin/sh +### BEGIN INIT INFO +# Provides: repmgrd +# Required-Start: $local_fs $remote_fs $network $syslog $postgresql +# Required-Stop: $local_fs $remote_fs $network $syslog $postgresql +# Should-Start: $syslog $postgresql +# Should-Start: $syslog $postgresql +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start/stop repmgrd +### END INIT INFO + +set -e + +if test -f /etc/default/repmgrd; then + . /etc/default/repmgrd +fi + +if [ -z "$REPMGRD_BIN" ]; then + REPMGRD_BIN="/usr/bin/repmgrd" +fi + +if [ -z "$REPMGRD_PIDFILE" ]; then + REPMGRD_PIDFILE="/var/run/repmgrd.pid" +fi + +test -x $REPMGRD_BIN || exit 0 + +case "$REPMGRD_ENABLE" in + [Nn]*) + exit 0 + ;; +esac + +case "$1" in + start) + start-stop-daemon --start --quiet --make-pidfile --pidfile $REPMGRD_PIDFILE --exec $REPMGRD_BIN $REPMGRD_OPTS + ;; + + stop) + start-stop-daemon --stop --oknodo --quiet --pidfile $REPMGRD_PIDFILE + ;; + + restart) + $0 stop && $0 start || exit 1 + ;; + + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 + ;; +esac + +exit 0