Many initscripts incorrectly reload on runlevel change. This is due to the
'daemon' function in /etc/init.d/functions returning incorrect exit status
since the addition of libsafe support.
The function exits with 'unset LD_PRELOAD' which replaces the exit status of
the executed daemon.
Patch is attached to correctly return daemon exit status.
--
John P. Silva [EMAIL PROTECTED]
--- functions.orig Sat Sep 15 20:17:52 2001
+++ functions Sun Sep 16 14:18:51 2001
@@ -163,7 +163,7 @@
daemon() {
# Test syntax.
local gotbase=
- local base= user= nice= bg= pid
+ local base= user= nice= bg= pid= retval=
nicelevel=0
while [ "$1" != "${1##[-+]}" ]; do
case $1 in
@@ -224,7 +224,9 @@
$nice initlog $INITLOG_ARGS -c "su - $user -c \"$*\"" && success "%s startup" $base || failure "%s startup" $base
fi
[ $? = 0 ] && success "%s startup" $base || failure "%s startup" $base
+ retval=$?
unset LD_PRELOAD
+ return $retval
}
# A function to stop a program.