X-Git-Url: http://git.onelab.eu/?p=monitor.git;a=blobdiff_plain;f=monitor-runlevelagent.init;h=165f7e8ed992a6ac95caa518e04b15c12f606864;hp=4923c6d98e57b9dafa436aee71609d159e373a46;hb=HEAD;hpb=a837fdf2c23d08ff99f083fa9fb04360d7323f80 diff --git a/monitor-runlevelagent.init b/monitor-runlevelagent.init index 4923c6d..165f7e8 100644 --- a/monitor-runlevelagent.init +++ b/monitor-runlevelagent.init @@ -13,23 +13,34 @@ # $Id$ # +function start_rla () +{ + args=$1 + ret=$( pgrep -f -l RunlevelAgent ) + if [[ -z $ret ]] ; then + echo "Starting RunlevelAgent" + if [[ -f RunlevelAgent.py ]] ; then + RLA="/usr/bin/python ./RunlevelAgent.py" + else + RLA=/usr/bin/RunlevelAgent.py + fi + $RLA $args > /var/log/rla.log 2>&1 & + fi +} + case "$1" in start|restart|reload) - start_rla + start_rla $2 ;; stop|status) - exit 0 + pkill -f RunlevelAgent + exit 0 ;; *) - echo $"Usage: $0 {start|stop|restart|status}" + echo $"Usage: $0 {start|stop|restart|status}" exit 1 ;; esac -function start_rla () -{ - RLA=/usr/bin/RunlevelAgent.py - $RLA &> /var/log/rla.log & -}