[PLUG] Probing init scripts...

Michael C. Robinson michael at goose.robinson-west.com
Tue Aug 26 21:02:02 UTC 2003


# Check if $pid (could be plural) are running
checkpid() {
        while [ "$1" ]; do
           [ -d /proc/$1 ] && return 0
           shift
        done
        return 1
}


What is shift doing here?  Some kind of bit shifting?
This is out of functions on redhat 7.3, one of the init
funcitons.  This appears to be a loop checking for files
but where is $1 coming from?  I guess -d in the conditional
tests that a file exists and is a directory but I don't see
how this tests for running processes.

Another thing I've been running into a lot are
lines like the following... 

if [ "${BOOTUP:-}" != "verbose" ]; then

What's going on with ${BOOTUP:-}?  Is the latter
defined somewhere or is it being defined here?
Why the brackets?  Are the characters :- part of
a variable name?

What is the overall purpose of the functions script?
I'm trying to decipher rc.sysinit to see how I might
modify for booting via nfs-root instead.

     --  Michael




More information about the PLUG mailing list