rh9init script

Download, Add a comment, Back to main page
[2004-11-06 06:59 CST] boogie (email) i'm using this script, but nothing happen. my jabber doesn't work with this script. I didn't know what's wrong with this server, coz this isn't first time i'm using this script. Any Idea?

#!/bin/sh
#
# chkconfig: - 91 35
# description: Starts and stops the Jabber Server
#
# Written on 09/05/2003 by Todd Murray
# Contact - wonderer@wonderer.net
#

#
# Written for use on Redhat 9.0 with the following changes
#
# Configuration directory - /usr/jabber/
# PID directory - /var/lock/jabber/
# Log directory - /var/log/jabber/
# Spool directory - /var/spool/jabber/yourhosthere/

#
# Make sure to adjust the following variables to match your configuration
# 
# Legend:
# JDIR = Jabber Directory - i.e /usr/local/jabber
# BIN = Jabberd Binary file - You should not need to change this unless you have put the binary 
# in a alternate location
# CONF = Jabber Directory containing the configuration files
#
              
JDIR=/usr/local/jabber
BIN=$JDIR/jabberd/jabberd 
CONF=/etc/jabber

# Source function library.
if [ -f /etc/init.d/functions ] ; then
  . /etc/init.d/functions
elif [ -f /etc/rc.d/init.d/functions ] ; then
  . /etc/rc.d/init.d/functions
else
  exit 0
fi

# Avoid using root's TMPDIR
unset TMPDIR

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# Check that jabber.xml exists.
[ -f $CONF/main.xml ] || exit 0

RETVAL=0


start() {
	echo -n $"Starting jabberd services: "
	daemon $BIN -c $CONF/main.xml -B
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/jabber/main.pid || RETVAL=1
	return $RETVAL
}	

stop() {
	echo -n $"Shutting down jabberd services: "
	killproc jabberd
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/jabber/main.pid
	echo 
	return $RETVAL
}	

restart() {
	stop
	start
}	

reload() {
      echo -n $"Reloading jabberd configuration files: "
	killproc jabberd -HUP
	RETVAL=$?
	echo
	return $RETVAL
}	

rhstatus() {
	status jabberd
}	

case "$1" in
  start)
  	start
	;;
  stop)
  	stop
	;;
  restart)
  	restart
	;;
  reload)
  	reload
	;;
  status)
  	rhstatus
	;;
  condrestart)
  	[ -f /var/lock/jabber/jabber.pid ] && restart || :
	;;
  *)
	echo $"Usage: $0 {start|stop|restart|reload|status|condrestart}"
	exit 1
esac

exit $?