patch: ovdb & rc.news

Miquel van Smoorenburg miquels at cistron.nl
Wed May 31 23:27:20 UTC 2000


In article <cistron.200005311907.OAA27206 at darkside.norand.com>,
Heath Kehoe  <heath.kehoe at intermec.com> wrote:
>!     # wait for innd to exit (up to 60 sec)
>!     i=12
>!     while [ $i -gt 0 ];
>!     do
>! 	if [ -f ${SERVERPID} ]; then
>! 	    sleep 5
>! 	    let i=i-1
>! 	else
>! 	    i=0
>! 	fi
>!     done

This is bad for 2 reasons:

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

Something like this would be better:

	# wait for innd to exit (up to 60 sec)
	echo -n "Stopping innd: "
	[ -f ${SERVERPID} ] && kill -TERM ${SERVERPID} 2>/dev/null
	i=12
	while [ $i -gt 0]
	do
		pid=`cat ${SERVERPID} 2>/dev/null`
		[ "$pid" = "" ] && break
		kill -CONT $pid 2>/dev/null || break
		sleep 5
		echo -n "."
		i=`expr $i - 1`
	done
	echo "done."

>!   i=12
>!   while [ $i -gt 0 ];
>!   do
>!     if [ -f $PATHRUN/db_checkpoint.pid ]; then
>!       sleep 5
>!       let i=i-1
>!     else
>!       i=0
>!     fi
>!   done

Same here.

Mike.



More information about the inn-patches mailing list