patch: ovdb & rc.news

Katsuhiro Kondou kondou at nec.co.jp
Thu Jun 1 02:22:58 UTC 2000


In article <8h474o$dr7$1 at enterprise.cistron.net>,
	miquels at cistron.nl (Miquel van Smoorenburg) wrote;

} 1. If INN crashed and left the pid file behind you'd hang for 60 secs
} 2. "let" is a ksh-ism

I've already committed, but I should have looked it
more carefully.  Here is a one I wrote.  I tried not
to use 'echo -n', since it cannot be understood by
sh in some Unix boxes.
-- 
Katsuhiro Kondou

--- scripts/rc.news.in.orig	Thu Jun  1 07:16:31 2000
+++ scripts/rc.news.in	Thu Jun  1 09:52:51 2000
@@ -26,16 +26,18 @@
     fi
 
     # wait for innd to exit (up to 60 sec)
+    printf "Stopping innd: " 
     i=12
     while [ $i -gt 0 ];
     do
-	if [ -f ${SERVERPID} ]; then
-	    sleep 5
-	    let i=i-1
-	else
-	    i=0
-	fi
+	pid=`cat ${SERVERPID} 2>/dev/null`
+	[ "$pid" = "" ] && break
+	kill -0 $pid 2>/dev/null || break
+	sleep 5
+	printf "."
+	i=`expr $i - 1`
     done
+    printf "\n"
 
     # Turn off ovdb support procs, and close the DB environment
     if [ "$OVMETHOD" = "ovdb" -a -n "$DB_HOME" ]; then



More information about the inn-patches mailing list