[sr-dev] git:master: pdb: add debian init file

Henning Westerholt hw at kamailio.org
Mon Feb 24 11:25:52 CET 2014


Module: sip-router
Branch: master
Commit: 3cdebcbb27568487574ed56274733e5c64431cc0
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=3cdebcbb27568487574ed56274733e5c64431cc0

Author: Henning Westerholt <hw at kamailio.org>
Committer: Henning Westerholt <hw at kamailio.org>
Date:   Mon Feb 24 11:23:42 2014 +0100

pdb: add debian init file

---

 utils/pdbt/debian/pdb-server.init.d |   48 +++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/utils/pdbt/debian/pdb-server.init.d b/utils/pdbt/debian/pdb-server.init.d
new file mode 100644
index 0000000..49a9b31
--- /dev/null
+++ b/utils/pdbt/debian/pdb-server.init.d
@@ -0,0 +1,48 @@
+#! /bin/sh
+
+PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+DAEMON=/usr/bin/pdb_server
+NAME=pdb_server
+DESC=pdb_server
+PIDFILE=/var/run/pdb_server.pid
+
+test -x $DAEMON || exit 0
+
+# Include pdb_server defaults if available
+if [ -f /etc/default/pdb_server ] ; then
+        . /etc/default/pdb_server
+fi
+
+# Include pdb_server config if available
+if [ -f /etc/pdb_server.conf ] ; then
+        . /etc/pdb_server.conf
+fi
+
+set -e
+
+case "$1" in
+  start)
+        echo -n "Starting $DESC: "
+        start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE -c $PDBUSER -g $PDBGROUP --exec $DAEMON -- -d -m "$MMAPFILE" -i "$BINDADDR" -p "$BINDPORT"
+        echo "."
+        ;;
+  stop)
+        echo -n "Stopping $DESC: "
+        # start-stop-daemon --stop --pidfile $PIDFILE --exec $DAEMON
+        if pgrep -x $NAME &> /dev/null; then killall $NAME; fi
+        rm -f $PIDFILE
+        echo "$NAME."
+        ;;
+  restart|force-reload)
+        if pgrep -x $NAME &> /dev/null; then killall $NAME; fi
+        rm -f $PIDFILE
+        start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE -c $PDBUSER -g $PDBGROUP --exec $DAEMON -- -d -m "$MMAPFILE" -i "$BINDADDR" -p "$BINDPORT"
+        ;;
+  *)
+        N=/etc/init.d/$NAME
+        echo "Usage: $N {start|stop|restart|force-reload}" >&2
+        exit 1
+        ;;
+esac
+
+exit 0




More information about the sr-dev mailing list