[sr-dev] git:3.3: pkg/kamailio/deb: fix init script

Victor Seva linuxmaniac at torreviejawireless.org
Wed Feb 19 09:50:25 CET 2014


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

Author: Victor Seva <linuxmaniac at torreviejawireless.org>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date:   Tue Feb 18 16:30:28 2014 +0100

pkg/kamailio/deb: fix init script

(cherry picked from commit 424ab9dd4abd9b11b7cf4642335652145128fa7c)
(cherry picked from commit 5f038ee927c40779296db080afab99ff3da47f05)

---

 pkg/kamailio/deb/debian/kamailio.init  |   14 +++++---------
 pkg/kamailio/deb/lenny/kamailio.init   |   14 +++++---------
 pkg/kamailio/deb/lucid/kamailio.init   |   14 +++++---------
 pkg/kamailio/deb/precise/kamailio.init |   14 +++++---------
 pkg/kamailio/deb/squeeze/kamailio.init |   14 +++++---------
 pkg/kamailio/deb/wheezy/kamailio.init  |   14 +++++---------
 6 files changed, 30 insertions(+), 54 deletions(-)

diff --git a/pkg/kamailio/deb/debian/kamailio.init b/pkg/kamailio/deb/debian/kamailio.init
index e8c1765..7c08563 100644
--- a/pkg/kamailio/deb/debian/kamailio.init
+++ b/pkg/kamailio/deb/debian/kamailio.init
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
 if test "$DUMP_CORE" = "yes" ; then
     # set proper ulimit
     ulimit -c unlimited
-    
+
     # directory for the core dump files
     # COREDIR=/home/corefiles
     # [ -d $COREDIR ] || mkdir $COREDIR
@@ -138,18 +138,14 @@ case "$1" in
 	check_kamailio_config
 	create_radius_seqfile
 
-	log_daemon_msg "Restarting $DESC: $NAME"
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
-		$PIDFILE --exec $DAEMON
+	$0 stop
 	sleep 1
-	start-stop-daemon --start --quiet --pidfile \
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
-	log_end_msg 0
+	$0 start
 	;;
   status)
 	log_daemon_msg "Status of $DESC: "
-	
-	status_of_porc "$PIDFILE" $NAME $NAME
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
 	;;
   *)
 	N=/etc/init.d/$NAME
diff --git a/pkg/kamailio/deb/lenny/kamailio.init b/pkg/kamailio/deb/lenny/kamailio.init
index e8c1765..7c08563 100644
--- a/pkg/kamailio/deb/lenny/kamailio.init
+++ b/pkg/kamailio/deb/lenny/kamailio.init
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
 if test "$DUMP_CORE" = "yes" ; then
     # set proper ulimit
     ulimit -c unlimited
-    
+
     # directory for the core dump files
     # COREDIR=/home/corefiles
     # [ -d $COREDIR ] || mkdir $COREDIR
@@ -138,18 +138,14 @@ case "$1" in
 	check_kamailio_config
 	create_radius_seqfile
 
-	log_daemon_msg "Restarting $DESC: $NAME"
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
-		$PIDFILE --exec $DAEMON
+	$0 stop
 	sleep 1
-	start-stop-daemon --start --quiet --pidfile \
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
-	log_end_msg 0
+	$0 start
 	;;
   status)
 	log_daemon_msg "Status of $DESC: "
-	
-	status_of_porc "$PIDFILE" $NAME $NAME
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
 	;;
   *)
 	N=/etc/init.d/$NAME
diff --git a/pkg/kamailio/deb/lucid/kamailio.init b/pkg/kamailio/deb/lucid/kamailio.init
index e8c1765..7c08563 100644
--- a/pkg/kamailio/deb/lucid/kamailio.init
+++ b/pkg/kamailio/deb/lucid/kamailio.init
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
 if test "$DUMP_CORE" = "yes" ; then
     # set proper ulimit
     ulimit -c unlimited
-    
+
     # directory for the core dump files
     # COREDIR=/home/corefiles
     # [ -d $COREDIR ] || mkdir $COREDIR
@@ -138,18 +138,14 @@ case "$1" in
 	check_kamailio_config
 	create_radius_seqfile
 
-	log_daemon_msg "Restarting $DESC: $NAME"
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
-		$PIDFILE --exec $DAEMON
+	$0 stop
 	sleep 1
-	start-stop-daemon --start --quiet --pidfile \
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
-	log_end_msg 0
+	$0 start
 	;;
   status)
 	log_daemon_msg "Status of $DESC: "
-	
-	status_of_porc "$PIDFILE" $NAME $NAME
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
 	;;
   *)
 	N=/etc/init.d/$NAME
diff --git a/pkg/kamailio/deb/precise/kamailio.init b/pkg/kamailio/deb/precise/kamailio.init
index e8c1765..7c08563 100644
--- a/pkg/kamailio/deb/precise/kamailio.init
+++ b/pkg/kamailio/deb/precise/kamailio.init
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
 if test "$DUMP_CORE" = "yes" ; then
     # set proper ulimit
     ulimit -c unlimited
-    
+
     # directory for the core dump files
     # COREDIR=/home/corefiles
     # [ -d $COREDIR ] || mkdir $COREDIR
@@ -138,18 +138,14 @@ case "$1" in
 	check_kamailio_config
 	create_radius_seqfile
 
-	log_daemon_msg "Restarting $DESC: $NAME"
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
-		$PIDFILE --exec $DAEMON
+	$0 stop
 	sleep 1
-	start-stop-daemon --start --quiet --pidfile \
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
-	log_end_msg 0
+	$0 start
 	;;
   status)
 	log_daemon_msg "Status of $DESC: "
-	
-	status_of_porc "$PIDFILE" $NAME $NAME
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
 	;;
   *)
 	N=/etc/init.d/$NAME
diff --git a/pkg/kamailio/deb/squeeze/kamailio.init b/pkg/kamailio/deb/squeeze/kamailio.init
index e8c1765..7c08563 100644
--- a/pkg/kamailio/deb/squeeze/kamailio.init
+++ b/pkg/kamailio/deb/squeeze/kamailio.init
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
 if test "$DUMP_CORE" = "yes" ; then
     # set proper ulimit
     ulimit -c unlimited
-    
+
     # directory for the core dump files
     # COREDIR=/home/corefiles
     # [ -d $COREDIR ] || mkdir $COREDIR
@@ -138,18 +138,14 @@ case "$1" in
 	check_kamailio_config
 	create_radius_seqfile
 
-	log_daemon_msg "Restarting $DESC: $NAME"
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
-		$PIDFILE --exec $DAEMON
+	$0 stop
 	sleep 1
-	start-stop-daemon --start --quiet --pidfile \
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
-	log_end_msg 0
+	$0 start
 	;;
   status)
 	log_daemon_msg "Status of $DESC: "
-	
-	status_of_porc "$PIDFILE" $NAME $NAME
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
 	;;
   *)
 	N=/etc/init.d/$NAME
diff --git a/pkg/kamailio/deb/wheezy/kamailio.init b/pkg/kamailio/deb/wheezy/kamailio.init
index e8c1765..7c08563 100644
--- a/pkg/kamailio/deb/wheezy/kamailio.init
+++ b/pkg/kamailio/deb/wheezy/kamailio.init
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
 if test "$DUMP_CORE" = "yes" ; then
     # set proper ulimit
     ulimit -c unlimited
-    
+
     # directory for the core dump files
     # COREDIR=/home/corefiles
     # [ -d $COREDIR ] || mkdir $COREDIR
@@ -138,18 +138,14 @@ case "$1" in
 	check_kamailio_config
 	create_radius_seqfile
 
-	log_daemon_msg "Restarting $DESC: $NAME"
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
-		$PIDFILE --exec $DAEMON
+	$0 stop
 	sleep 1
-	start-stop-daemon --start --quiet --pidfile \
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
-	log_end_msg 0
+	$0 start
 	;;
   status)
 	log_daemon_msg "Status of $DESC: "
-	
-	status_of_porc "$PIDFILE" $NAME $NAME
+
+	status_of_proc -p"$PIDFILE" $NAME $NAME
 	;;
   *)
 	N=/etc/init.d/$NAME




More information about the sr-dev mailing list