Browse code

pkg/kamailio/deb: fix init script

Victor Seva authored on 18/02/2014 15:30:28
Showing 5 changed files
... ...
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
99 99
 if test "$DUMP_CORE" = "yes" ; then
100 100
     # set proper ulimit
101 101
     ulimit -c unlimited
102
-    
102
+
103 103
     # directory for the core dump files
104 104
     # COREDIR=/home/corefiles
105 105
     # [ -d $COREDIR ] || mkdir $COREDIR
... ...
@@ -138,18 +138,14 @@ case "$1" in
138 138
 	check_kamailio_config
139 139
 	create_radius_seqfile
140 140
 
141
-	log_daemon_msg "Restarting $DESC: $NAME"
142
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
143
-		$PIDFILE --exec $DAEMON
141
+	$0 stop
144 142
 	sleep 1
145
-	start-stop-daemon --start --quiet --pidfile \
146
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
147
-	log_end_msg 0
143
+	$0 start
148 144
 	;;
149 145
   status)
150 146
 	log_daemon_msg "Status of $DESC: "
151
-	
152
-	status_of_porc "$PIDFILE" $NAME $NAME
147
+
148
+	status_of_proc -p"$PIDFILE" $NAME $NAME
153 149
 	;;
154 150
   *)
155 151
 	N=/etc/init.d/$NAME
... ...
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
99 99
 if test "$DUMP_CORE" = "yes" ; then
100 100
     # set proper ulimit
101 101
     ulimit -c unlimited
102
-    
102
+
103 103
     # directory for the core dump files
104 104
     # COREDIR=/home/corefiles
105 105
     # [ -d $COREDIR ] || mkdir $COREDIR
... ...
@@ -138,18 +138,14 @@ case "$1" in
138 138
 	check_kamailio_config
139 139
 	create_radius_seqfile
140 140
 
141
-	log_daemon_msg "Restarting $DESC: $NAME"
142
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
143
-		$PIDFILE --exec $DAEMON
141
+	$0 stop
144 142
 	sleep 1
145
-	start-stop-daemon --start --quiet --pidfile \
146
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
147
-	log_end_msg 0
143
+	$0 start
148 144
 	;;
149 145
   status)
150 146
 	log_daemon_msg "Status of $DESC: "
151
-	
152
-	status_of_porc "$PIDFILE" $NAME $NAME
147
+
148
+	status_of_proc -p"$PIDFILE" $NAME $NAME
153 149
 	;;
154 150
   *)
155 151
 	N=/etc/init.d/$NAME
... ...
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
99 99
 if test "$DUMP_CORE" = "yes" ; then
100 100
     # set proper ulimit
101 101
     ulimit -c unlimited
102
-    
102
+
103 103
     # directory for the core dump files
104 104
     # COREDIR=/home/corefiles
105 105
     # [ -d $COREDIR ] || mkdir $COREDIR
... ...
@@ -138,18 +138,14 @@ case "$1" in
138 138
 	check_kamailio_config
139 139
 	create_radius_seqfile
140 140
 
141
-	log_daemon_msg "Restarting $DESC: $NAME"
142
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
143
-		$PIDFILE --exec $DAEMON
141
+	$0 stop
144 142
 	sleep 1
145
-	start-stop-daemon --start --quiet --pidfile \
146
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
147
-	log_end_msg 0
143
+	$0 start
148 144
 	;;
149 145
   status)
150 146
 	log_daemon_msg "Status of $DESC: "
151
-	
152
-	status_of_porc "$PIDFILE" $NAME $NAME
147
+
148
+	status_of_proc -p"$PIDFILE" $NAME $NAME
153 149
 	;;
154 150
   *)
155 151
 	N=/etc/init.d/$NAME
... ...
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
99 99
 if test "$DUMP_CORE" = "yes" ; then
100 100
     # set proper ulimit
101 101
     ulimit -c unlimited
102
-    
102
+
103 103
     # directory for the core dump files
104 104
     # COREDIR=/home/corefiles
105 105
     # [ -d $COREDIR ] || mkdir $COREDIR
... ...
@@ -138,18 +138,14 @@ case "$1" in
138 138
 	check_kamailio_config
139 139
 	create_radius_seqfile
140 140
 
141
-	log_daemon_msg "Restarting $DESC: $NAME"
142
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
143
-		$PIDFILE --exec $DAEMON
141
+	$0 stop
144 142
 	sleep 1
145
-	start-stop-daemon --start --quiet --pidfile \
146
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
147
-	log_end_msg 0
143
+	$0 start
148 144
 	;;
149 145
   status)
150 146
 	log_daemon_msg "Status of $DESC: "
151
-	
152
-	status_of_porc "$PIDFILE" $NAME $NAME
147
+
148
+	status_of_proc -p"$PIDFILE" $NAME $NAME
153 149
 	;;
154 150
   *)
155 151
 	N=/etc/init.d/$NAME
... ...
@@ -99,7 +99,7 @@ MEMORY=$((`echo $MEMORY | sed -e 's/[^0-9]//g'`))
99 99
 if test "$DUMP_CORE" = "yes" ; then
100 100
     # set proper ulimit
101 101
     ulimit -c unlimited
102
-    
102
+
103 103
     # directory for the core dump files
104 104
     # COREDIR=/home/corefiles
105 105
     # [ -d $COREDIR ] || mkdir $COREDIR
... ...
@@ -138,18 +138,14 @@ case "$1" in
138 138
 	check_kamailio_config
139 139
 	create_radius_seqfile
140 140
 
141
-	log_daemon_msg "Restarting $DESC: $NAME"
142
-	start-stop-daemon --oknodo --stop --quiet --pidfile \
143
-		$PIDFILE --exec $DAEMON
141
+	$0 stop
144 142
 	sleep 1
145
-	start-stop-daemon --start --quiet --pidfile \
146
-		$PIDFILE --exec $DAEMON  -- $OPTIONS
147
-	log_end_msg 0
143
+	$0 start
148 144
 	;;
149 145
   status)
150 146
 	log_daemon_msg "Status of $DESC: "
151
-	
152
-	status_of_porc "$PIDFILE" $NAME $NAME
147
+
148
+	status_of_proc -p"$PIDFILE" $NAME $NAME
153 149
 	;;
154 150
   *)
155 151
 	N=/etc/init.d/$NAME