Permalink
Browse files

Files to create the debian package

Patch by: Christian Kruse
  • Loading branch information...
1 parent 8e7b487 commit 6693b99288dfba321aaea628735e73654224b699 @Jaime2ndQuadrant Jaime2ndQuadrant committed Dec 19, 2013
Showing with 62 additions and 0 deletions.
  1. +14 −0 debian/repmgr.repmgrd.default
  2. +48 −0 debian/repmgr.repmgrd.init
@@ -0,0 +1,14 @@
+#!/bin/sh
+# default settings for repmgrd. This file is source by /bin/sh from
+# /etc/init.d/repmgrd
+
+# Options for repmgrd
+REPMGRD_OPTS=""
+
+# repmgrd binary
+REPMGR_BIN="/usr/bin/repmgr"
+
+# pid file
+REPMGR_PIDFILE="/var/run/repmgrd.pid"
+
+
@@ -0,0 +1,48 @@
+#!/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 "$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

0 comments on commit 6693b99

Please sign in to comment.