#!/bin/bash # Author: Jonathan Sprinkle # # icegridregistry Startup script for the Ice grid registry # # chkconfig: - 85 15 # description: The icegridregistry maintains a list of platforms with # available middleware services/interfaces provided. # processname: icegridregistry # config: /etc/default/icegridregistry # pidfile: /var/run/icegridregistry.pid # ### BEGIN INIT INFO # Provides: icegridregistry # Required-Start: $local_fs $remote_fs $network $named # Required-Stop: $local_fs $remote_fs $network # Should-Start: # Short-Description: start and stop IceGridRegistry daemon # Description: The icegridregistry maintains a list of platforms with # available middleware services/interfaces provided. ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions if [ -f /etc/default/icegridregistry ]; then . /etc/default/icegridregistry fi # Path to the apachectl script, server binary, and short-form for messages. #apachectl=/usr/sbin/apachectl #httpd=${HTTPD-/usr/sbin/httpd} icegridregistry=/usr/bin/icegridregistry prog=icegridregistry pidfile=${PIDFILE-/var/run/icegridregistry.pid} lockfile=${LOCKFILE-/var/lock/subsys/icegridregistry} RETVAL=0 # So we just do it the way init scripts # are expected to behave here. start() { echo -n $"Starting $prog: " $icegridregistry --pidfile ${pidfile} $ICECONFIG --daemon --nochdir #$icegridregistry --pidfile ${pidfile} --$ICECONFIG --daemon --nochdir RETVAL=$? echo [ $RETVAL = 0 ] && touch ${lockfile} return $RETVAL } # When stopping icegridregistry, we give a delay of >10 second before SIGKILLing the # icegridregistry parent; this gives enough time for the parent to SIGKILL any # errant children. # (maybe over the top, but we have plenty of time...) stop() { echo -n $"Stopping $prog: " killproc -p ${pidfile} -d 10 $icegridregistry RETVAL=$? echo [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} } # See how we were called. case "$1" in start) start ;; stop) stop ;; status) status $httpd RETVAL=$? ;; restart) stop start ;; condrestart) if [ -f ${pidfile} ] ; then stop start fi ;; *) echo $"Usage: $prog {start|stop|restart|condrestart|status}" RETVAL=3 esac exit $RETVAL