[lug] Redhat doesn't support users that compile their own kernels.

John Karns jkarns at csd.net
Thu Nov 8 06:38:29 MST 2001

On Sun, 4 Nov 2001, Ed Hill said:

    3) Accordiung to the LSB v1.0.1-011030, there is *NO* requirement
>       that any of the init scripts return an "[  OK  ]" or "[FAILED]"
>       as you demand.  There *ARE* requirements about the return types
>       of the scripts, but the output sent to stdout as you desire is
>       clearly not a requirement.
>    4) Further anecdotal evidence of correctness:  Of the 52 Sys-V-style
>       init scripts (/etc/rc.d/init.d/) in one of my recent installs of
>       RH v7.2, I ran the following:
>         grep "exit 0" /etc/rc.d/init.d/* | gawk -F ':' '{print $1}' | uniq | wc -l
>       to verify that 42 out of 52 contain "exit 0" clauses.  Of course,
>       the ipchains and iptables scripts were among the 42.
>       So the vast majority of the init scripts can, in theory at least,
>       exit without ever emitting an '[  OK  ]' or '[FAILED]' statement
>       to stdout.  This appears to be normal and perfectly acceptable
>       behavior.

I don't wish to get involved in a lot of controversy over this, but on my
SuSE 7.1 install, this is also the case, i.e., almost all init scripts
have an "exit 0" clause.  However, a closer look shows that they are at
the top of the script.  The "exit 0" is executed iff the particular
feature / daemon which the script starts has been selectively disabled in
the one of the system configuration rc files.  If disabled, then the init
script exits silently via "exit 0".  However, if the script continues
beyond that point, exit is via other codes, with the exception that there
is also a 0 exit code at the very bottom of the script as a matter of
completeness it would seem.

top of script:

. /etc/rc.config
. /etc/rc.config.d/apmd.rc.config

test $link = $base && START_APMD=yes
test "$START_APMD" = "yes" || exit 0


and at the bottom of the script:

# Inform the caller not only verbosely and set an exit status.
test "$return" = "$rc_done" || exit 1
exit 0

John Karns                                        jkarns at csd.net

More information about the LUG mailing list