Tom Lane wrote:
> 
> Bruce Momjian <[EMAIL PROTECTED]> writes:
> > killproc should send a kill -15 to the process, wait a few seconds for
> > it to exit.  If it does not, try kill -1, and if that doesn't kill it,
> > then kill -9.
> 
> Tell it to the Linux people ... this is their boot-script code we're
> talking about.

RedHat, in particular.  I can't vouch for any others.

On my RH 6.2 box, with initscripts-5.00-1 loaded, here's what killproc
does if no killlevel is set (even though a default $killlevel is set to
-9, it's not used in this code):
($pid is the pid of the proc to kill, $base is the name of the proc,
etc)

   if [ "$notset" = "1" ] ; then
      if ps h $pid>/dev/null 2>&1; then
         # TERM first, then KILL if not dead
         kill -TERM $pid
         usleep 100000
         if ps h $pid >/dev/null 2>&1 ; then
            sleep 1
            if ps h $pid >/dev/null 2>&1 ; then
               sleep 3
               if ps h $pid >/dev/null 2>&1 ; then
                  kill -KILL $pid
               fi
            fi
         fi
      fi
      ps h $pid >/dev/null 2>&1
      RC=$?
      [ $RC -eq 0 ] && failure "$base shutdown" || success "$base
shutdown"
      RC=$((! $RC))
      # use specified level only
  else
      if ps h $pid >/dev/null 2>&1; then
         kill $killlevel $pid
         RC=$?
         [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base
$killlevel"
      fi
  fi


Is 6.1 this different from 6.2?  This code on the surface seems
reasonable to me -- am I missing something?  The 6.2 code (found in
/etc/rc.d/init.d/functions, for those who might not know where to find
killproc) sets a default killlevel but never uses it -- ignorant but not
stupid.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to