FS#12459 - [preload] bug in /etc/rc.d/preload : restart does not work

Attached to Project: Community Packages
Opened by solsTiCe (zebul666) - Monday, 15 December 2008, 12:51 GMT
Last edited by Dan Griffiths (Ghost1227) - Wednesday, 03 June 2009, 06:19 GMT
Task Type Bug Report
Category
Status Closed
Assigned To Jaroslaw Swierczynski (swiergot)
Dan Griffiths (Ghost1227)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

when you attempt to restart preload daemon with
/etc/rc.d/preload restart
the daemon is only stopped not (re)started:

:: Stopping preload daemon : [DONE]

there is a bug in /etc/rc.d/preload
one need to add a line like this in stop() function
PID=""

to make it look like this
stop() {
stat_busy "Stopping preload daemon: "
kill $PID &>/dev/null
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
rm_daemon preload
stat_done
PID=""
else
stat_fail
fi
return $RETVAL
}

or see the attached patch

note to the maintainer: look at what you write. and test it please !
that's already 2 bugs in 2 days i field for the same package !

at least for a /etc/rc.d script simply copy & paste from another script

thnx
This task depends upon

Closed by  Dan Griffiths (Ghost1227)
Wednesday, 03 June 2009, 06:19 GMT
Reason for closing:  Fixed
Additional comments about closing:  Sorry... meant to add that.
Comment by solsTiCe (zebul666) - Monday, 15 December 2008, 18:29 GMT
in fact instead of using the PID="" line, one can use the snippet of code in the case :

restart)
$0 stop
sleep 1
$0 start
;;

instead of a restart function

that's the way it is done in most /etc/rc.d script
Comment by solsTiCe (zebul666) - Tuesday, 02 June 2009, 08:05 GMT
ooops. i am very sorry.
it seems that
restart)
$0 stop
sleep 1
$0 start
;;
is not enough

only really need to add a PID="" in stop function after killall

Loading...