diff options
author | Bill Nottingham <notting@redhat.com> | 1999-03-16 07:38:56 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 1999-03-16 07:38:56 +0000 |
commit | a309d303aee5523519dfe71844eb6d6cc7396bea (patch) | |
tree | fcaf390942e720add3a646fde1783238e76b79ac /rc.d | |
parent | 920bffaf7e0915f8faadb4090d18a23875dca793 (diff) | |
download | initscripts-a309d303aee5523519dfe71844eb6d6cc7396bea.tar initscripts-a309d303aee5523519dfe71844eb6d6cc7396bea.tar.gz initscripts-a309d303aee5523519dfe71844eb6d6cc7396bea.tar.bz2 initscripts-a309d303aee5523519dfe71844eb6d6cc7396bea.tar.xz initscripts-a309d303aee5523519dfe71844eb6d6cc7396bea.zip |
add a 'PASSED' result
fix ROFS logging to be sane
Diffstat (limited to 'rc.d')
-rwxr-xr-x | rc.d/init.d/functions | 79 |
1 files changed, 51 insertions, 28 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 1526b9f8..07e3bd6f 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -210,6 +210,16 @@ echo_failure() { return 1 } +echo_passed() { + [ "$BOOTUP" = "color" ] && $MOVE_TO_COL + echo -n "[" + [ "$BOOTUP" = "color" ] && $SETCOLOR_WARNING + echo -n "PASSED" + [ "$BOOTUP" = "color" ] && $SETCOLOR_NORMAL + echo -n "]" + return 1 +} + # Log that something succeeded success() { if [ -z "$IN_INITLOG" ]; then @@ -233,43 +243,56 @@ failure() { return $rc } +# Log that something passed, but may have had errors. Useful for fsck +passed() { + rc=$? + if [ -z "$IN_INITLOG" ]; then + initlog -n $0 -s "$1" -e 1 + else + echo "-n $0 -s \"$1\" -e 1" >&21 + fi + [ "$BOOTUP" != "verbose" ] && echo_passed + return $rc +} + # Run some action. Log its output. action() { STRING=$1 echo -n "$STRING " shift - if [ -z "$IN_INITLOG" ]; then +# if [ -z "$IN_INITLOG" ]; then initlog $INITLOG_ARGS -c "$*" && success "$STRING" || failure "$STRING" rc=$? echo return $rc - else - # This sucks. - output=`$*` - returncode=$? - if [ -n "$output" ]; then - cmdname=`basename $1` - initlogcmds=`echo $output | sed -e "s/^/ -n $cmdname -s \"/" | sed -e "s/$/\"/"` - echo "$initlogcmds" >&21 - fi - - if [ $returncode -eq 0 ]; then - [ "$BOOTUP" = "verbose" ] && { - if [ -n "$output" ]; then - echo - echo $output - else - echo - fi - } - success "$STRING" - else - echo $output - failure "$STRING" - fi - [ "$BOOTUP" != "verbose" ] && echo - return $returncode - fi +# fi +# else +# # This sucks. +# output=`$*` +# returncode=$? +# if [ -n "$output" ]; then +# cmdname=`basename $1` +# initlogcmds=`echo $output | sed -e "s/^/ -n $cmdname -s \"/" | sed -e "s/$/\"/"` +# echo "$initlogcmds" >&21 +# fi +# +# if [ $returncode -eq 0 ]; then +# [ "$BOOTUP" = "verbose" ] && { +# if [ -n "$output" ]; then +# echo +# echo $output +# else +# echo +# fi +# } +# success "$STRING" +# else +# echo $output +# failure "$STRING" +# fi +# [ "$BOOTUP" != "verbose" ] && echo +# return $returncode + # fi } # Confirm whether we really want to run this service |