Now cgred script can't return proper value. Because
stop()/start() functions return result of if [] when failing,
and result of wrong commands when succeeding.
So fix this.
Signed-off-by: Masaki Tachibana <tachibana@mxm.nes.nec.co.jp>
Signed-off-by: Jan Safranek <jsafrane@redhat.com>
if [ $RETVAL -ne 0 ]; then
return 7
fi
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$servicename
+ touch /var/lock/subsys/$servicename
+ if [ $? -ne 0 ]; then
+ return 1
+ fi
echo "`pidof $processname`" > $pidfile
+ return 0
}
stop()
killproc -p $pidfile $processname -TERM
RETVAL=$?
echo
- if [ $RETVAL -eq 0 ] ; then
- rm -f /var/lock/subsys/$servicename
- rm -f $pidfile
+ if [ $RETVAL -ne 0 ] ; then
+ return 1
fi
+ rm -f /var/lock/subsys/$servicename
+ rm -f $pidfile
+ return 0
}
# See how we are called