Re: sanity check in init.d
>> "MB" == Martin Bialasinski <martin@internet-treff.uni-koeln.de> writes:
>> "SG" == Steve Greenland <stevegr@debian.org> writes:
SG> Daemons *should* (I think) log their startup (or failure to do so)
SG> in /var/log/daemon.log (or whereever daemon.* is configured to
SG> log).
MB> Yes, Shaul also pointed this out. I had the analogy of usual
MB> commands in mind (no output = no error).
Another thing comes to my mind (as I took another look at the init.d
scripts):
They already report different kind of errors on start-up.
if [ ! -e /lib/modules/`uname -r`/fs/autofs.o ]; then
echo "Error: autofs support not available."
exit 0
fi
if [ "$IFACE" = "none" ] ; then
echo "DHCP client daemon is disabled."
exit
fi
if [ "$(id -u)" != "0" ]
then
echo "You must be root to start, stop or restart gpm."
exit 1
fi
if [ "`whoami`" != "root" ]
then
echo "You must be root to start, stop or restart mysqld."
exit 1
fi
etc.
These messages are a good thing IMHO. But we have to be
consistent. Either we don´t show any messages on failure or we show
messages on any failure (my preference).
With the current situation, the user can´t be sure about success or
failure. Some give error messages, some not... This is not good.
We should issue such messages to STDOUT. Messages by the daemon (*after*
it got started by the start-stop-daemon) should go to syslog.
Opinions?
Ciao,
Martin
Reply to: