Being a bit of a freak I actually tend to read my boot output. Well, when I'm not using that time to go grab a cup of coffee first thing on a Monday morning. However I don't always find Debian's default output as clear as I'd like (especially when I haven't had that coffee yet, or when I'm half watching a remote machine boot over its serial console). ISTR that RedHat had much nicer boot output (I'm talking about text based here, not the fancy Plymouth stuff) with a row of OK/FAILED etc down the right hand side that made it nice and obvious what was happening. Of course we can do that with Debian, at least for packages that use the lsb-base logging functions. Drop the following into /etc/lsb-base-logging.sh and enjoy a slightly prettier boot. I'm slowly filing wishlist bugs with patches for those bits and pieces I use that don't use lsb-base for their init script logging.
(This is mostly for my own future reference, because I keep trying to search for details on it and not finding exactly what I want. I forget where I even found the basis for this, though there are lots of similar snippets out there. I've not tried it with a concurrency based boot so it may well look horrible under that.)
# Colour our init scripts output
# int log_end_message (int exitstatus)
log_end_msg () {
# If no arguments were passed, return
if [ -z "${1:-}" ]; then
return 1
fi
retval=$1
log_end_msg_pre "$@"
# Only do the fancy stuff if we have an appropriate terminal
# and if /usr is already mounted
if log_use_fancy_output; then
RED=`$TPUT setaf 1`
GREEN=`$TPUT setaf 2`
YELLOW=`$TPUT setaf 3`
NORMAL=`$TPUT sgr0`
$TPUT hpa $((`$TPUT cols` - 12))
else
RED=''
GREEN=''
YELLOW=''
NORMAL=''
fi
if [ $1 -eq 0 ]; then
/bin/echo -e " [ ${GREEN}OK${NORMAL} ]"
elif [ $1 -eq 255 ]; then
/bin/echo -e " [${YELLOW}WARNING!${NORMAL}]"
else
/bin/echo -e " [ ${RED}FAILED${NORMAL} ]"
fi
log_end_msg_post "$@"
return $retval
}
log_action_end_msg () {
log_action_end_msg_pre "$@"
if [ -z "${2:-}" ]; then
end=""
else
end=" ($2)"
fi
/bin/echo -n "${end}"
# Only do the fancy stuff if we have an appropriate terminal
# and if /usr is already mounted
if log_use_fancy_output; then
RED=`$TPUT setaf 1`
BLUE=`$TPUT setaf 4`
NORMAL=`$TPUT sgr0`
$TPUT hpa $((`$TPUT cols` - 12))
else
RED=''
BLUE=''
NORMAL=''
fi
if [ $1 -eq 0 ]; then
/bin/echo -e " [ ${BLUE}DONE${NORMAL} ]"
else
/bin/echo -e " [ ${RED}FAILED${NORMAL} ]"
fi
log_action_end_msg_post "$@"
}
(This is mostly for my own future reference, because I keep trying to search for details on it and not finding exactly what I want. I forget where I even found the basis for this, though there are lots of similar snippets out there. I've not tried it with a concurrency based boot so it may well look horrible under that.)

Personally, I prefer a different approach to boot messages: you can easily distinguish failures if successful operation shuts up and doesn't print anything.
Nice tip! Very usable on monday.. (and friday :-))
Nice tip, thanks :)
How about filing a bug against the right package to include this by default?
Would make it easier to find in the future for others who won't need to remember on whos blog it's available. =)
@Anonymous: Yup, I can understand that approach but there are various cases when I like to know exactly how far it's got, so I like to see success messages as well as failures.
@fatal: It's a matter of personal preference. There's no extra information here over the normal Debian output, I just personally find it easier to watch scroll past. If it wasn't such a trivial snippet I'd consider packaging it up so you could just apt-get install it, but that's really overkill. I suppose it could go into the lsb-base package as an example.
> I suppose it could go into the lsb-base package as an example.
Why not even as the default?
Would you mind filing a wishlist bug against lsb-base?
I always love to see that colored aligned
OK/FAILED line other distributions give.
Especially if it shows some
"Starting XYZ... FATAL ERROR: cannot start OK"
or some
"Not starting XYZ as configured FAILED>".
Always good for a laugh.
Can You show example screen shots of both boot output?
i would like to try this but i have no file called lsb-base-logging.sh in my /etc and the directory /etc/lsb-base is empty...
can somebody tell me if i have to install some package or if i have to create a file?
thanks!
Quote "By bas on January 8, 2010 4:35 AM
i would like to try this but i have no file called lsb-base-logging.sh in my /etc and the directory /etc/lsb-base is empty...
can somebody tell me if i have to install some package or if i have to create a file?
thanks!"
# nano -w /etc/lsb-base-logging.sh
#####copy & paste this####
# Colour our init scripts output
# int log_end_message (int exitstatus)
log_end_msg () {
# If no arguments were passed, return
if [ -z "${1:-}" ]; then
return 1
fi
retval=$1
log_end_msg_pre "$@"
# Only do the fancy stuff if we have an appropriate terminal
# and if /usr is already mounted
if log_use_fancy_output; then
RED=`$TPUT setaf 1`
GREEN=`$TPUT setaf 2`
YELLOW=`$TPUT setaf 3`
NORMAL=`$TPUT sgr0`
$TPUT hpa $((`$TPUT cols` - 12))
else
RED=''
GREEN=''
YELLOW=''
NORMAL=''
fi
if [ $1 -eq 0 ]; then
/bin/echo -e " [ ${GREEN}OK${NORMAL} ]"
elif [ $1 -eq 255 ]; then
/bin/echo -e " [${YELLOW}WARNING!${NORMAL}]"
else
/bin/echo -e " [ ${RED}FAILED${NORMAL} ]"
fi
log_end_msg_post "$@"
return $retval
}
log_action_end_msg () {
log_action_end_msg_pre "$@"
if [ -z "${2:-}" ]; then
end=""
else
end=" ($2)"
fi
/bin/echo -n "${end}"
# Only do the fancy stuff if we have an appropriate terminal
# and if /usr is already mounted
if log_use_fancy_output; then
RED=`$TPUT setaf 1`
BLUE=`$TPUT setaf 4`
NORMAL=`$TPUT sgr0`
$TPUT hpa $((`$TPUT cols` - 12))
else
RED=''
BLUE=''
NORMAL=''
fi
if [ $1 -eq 0 ]; then
/bin/echo -e " [ ${BLUE}DONE${NORMAL} ]"
else
/bin/echo -e " [ ${RED}FAILED${NORMAL} ]"
fi
log_action_end_msg_post "$@"
}
#####save & exit####
# chmod +x /etc/lsb-base-logging.sh
How do you make the font smaller?