jabberd /etc/init.d script

Here is an example jabberd startup and shutdown script for Red Hat Linux. It is written so that it may be managed by chkconfig. Make sure to configure the environment variable JABBER_DIR for your environment.

1. Create /etc/init.d/jabberd

#!/bin/sh

# chkconfig: 345 15 85
# description: Startup and shutdown script for Jabber open source server.

JABBER_DIR=/usr/local/jabber-1.4.2/
export JABBER_DIR

case $1 in
'start' )
   su - jabber -c "$JABBER_DIR/jabberd/jabberd &"
   ;;
'stop' )
   kill `cat $JABBER_DIR/jabber.pid`
   rm $JABBER_DIR/jabber.pid
   ;;
*)
   echo "usage: `basename $0` {start|stop}"
esac 
2. Create startup and shutdown /etc/rc.? links by adding the jabberd script to chkconfig.

/sbin/chkconfig --add jabberd


Start jabberd:
/sbin/service jabberd start

Stop jabberd:
/sbin/service jabberd stop

Back to brandonhutchinson.com.

Last modified: 01/14/2004