Kamikaze 8.09.2, package bind-server

This patch fixes wrong error checking in stop() and adds checking for already running named.

Signed-off-by: Alvar Kusma <al...@raamat.polva.ee>

--
=<Alvar>=
diff -urN orig/etc/init.d/named patch/etc/init.d/named
--- orig/etc/init.d/named	2010-03-21 13:17:59.000000000 +0200
+++ patch/etc/init.d/named	2010-03-21 13:20:16.000000000 +0200
@@ -5,6 +5,11 @@
 pid_file=/var/run/named.pid
 
 start() {
+  if [ -e $pid_file ]
+  then
+     echo "  named already running with PID `cat $pid_file`"
+     return 1
+  fi
   echo Starting isc-bind
 
   /usr/sbin/named -c $config_file
@@ -21,13 +26,13 @@
   then
     kill `cat $pid_file`
 
-    if [ $? -eq 0 ]
+    if [ $? -ne 0 ]
     then
       echo "  PID " `cat $pid_file` not found
       echo "  Is the named server running?"
     fi
 
-    rm $pid_file
+    rm -f $pid_file
 
     else
     echo "  $pid_file not found"
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to