#! /bin/sh # # chkconfig: - 85 15 # description: jabberd2 is the next generation jabber server, \ # much more scalable than the first # processname: router resolver sm s2s c2s # Source function library. . /etc/rc.d/init.d/functions # Get config. . /etc/sysconfig/network if [ -f /etc/sysconfig/jabberd2 ];then . /etc/sysconfig/jabberd2 fi # Check that networking is up. if [ "$NETWORKING" = "no" ] then exit 0 fi RETVAL=0 name="jabberd2" start () { echo $"Starting $name... " for ((i=0; $i < ${#PROG[@]}; i++)) { proc=${PROG[$i]} prog="$PROGDIR/${PROG[$i]}" conf="$CONFDIR/${CONF[$i]}" if [ -x $prog -a -r $conf ] ; then echo -n $" Starting $proc: " su - $USER -c "$prog -c $conf & 2> /dev/null &" RETVAL=$? [ $RETVAL -eq 0 ] && success || failure echo "" usleep 250 fi } echo " ...done" } stop () { echo $"Stopping $name... " for ((i=0; $i < ${#PROG[@]}; i++)) { proc=${PROG[$i]} echo -n $" Stopping $proc: " killproc $proc RETVAL=$? [ $RETVAL -eq 0 ] && success || failure echo "" } echo " Killing straglers... " for pidfile in `ls $PIDDIR/*.pid` ; do pid=`cat $pidfile` pidname=${pidfile/.pid/} if checkpid $pid ; then echo -n $" Killing $pidname" kill $pid RETVAL=$? [ $RETVAL -eq 0 ] && success || failure echo "" fi rm -f $pidfile done echo " ...done" } restart () { stop start } # See how we were called. case "$1" in start) start ;; stop) stop ;; # status) # status arpwatch # ;; restart|reload) restart ;; # condrestart) # [ -f /var/lock/subsys/arpwatch ] && restart || : # ;; *) echo $"Usage: $0 {start|stop|restart}" exit 1 esac exit $?