X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=codemux.initscript;h=0bd5960a73ad255e0133f3e86de89645abdb7d1d;hb=a8b7cb67b667aa182d118264378c8b976363914e;hp=5a69a702cc6d58cbac681b810043613e887d8ed0;hpb=c208f01c6a4c8d896c81692f65a302b426cb7c5f;p=codemux.git diff --git a/codemux.initscript b/codemux.initscript index 5a69a70..0bd5960 100644 --- a/codemux.initscript +++ b/codemux.initscript @@ -12,6 +12,8 @@ RETVAL=0 pidfile=/var/run/$PROC.pid +[ -r /etc/sysconfig/codemux ] && . /etc/sysconfig/codemux + check_status() { pid=`cat $pidfile 2>/dev/null` # @@ -34,7 +36,8 @@ case "$1" in rm -f $pidfile fi - initlog -c /usr/local/planetlab/sbin/codemux + #initlog -c /usr/sbin/codemux # Depricated + /usr/sbin/codemux $CODEMUX_OPTS cmd=success check_status && touch /var/lock/subsys/$PROC || cmd=failure @@ -45,6 +48,7 @@ case "$1" in stop) echo -n "shutting down $PROC: " killproc $PROC + killproc $PROC RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$PROC @@ -61,8 +65,16 @@ case "$1" in echo 'not running' && exit 1 ;; + condrestart) + if test -f /var/lock/subsys/$PROC; then + $0 stop + $0 start + RETVAL=$? + fi + ;; + *) - echo "Usage: $0 {start|stop|restart|status}" + echo "Usage: $0 {start|stop|restart|status|condrestart}" RETVAL=1 esac