Logo Search packages:      
Sourcecode: jabber version File versions  Download package

init.d

#! /bin/sh
### BEGIN INIT INFO
# Provides:          jabber
# Required-Start:    $remote_fs
# Required-Stop:     $remote_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: jabber init script to start jabber daemon
### END INIT INFO
#
#     Created from Bernd Eckenfels <ecki@lina.inka.de>
#
#     Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#     Modified for Debian GNU/Linux
#     by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# Version:  @(#)skeleton  1.8  03-Mar-1998  miquels@cistron.nl
#
# This file was automatically customized by dh-make on Sun, 21 May 2000 12:31:20 +0200

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/jabberd
NAME=jabberd
DESC=jabberd
CONF=/etc/jabber/jabber.xml
PID=/var/run/jabber/jabber.pid
CMDLINE=""

. /etc/jabber/functions

test -f $DAEMON -a -f $CONF || exit 0

# set some parameters like JABBER_HOSTNAME
if test -x /etc/jabber/jabber.cfg; then
   . /etc/jabber/jabber.cfg
fi

if [ x"$JABBER_HOSTNAME" != x"" ]; then
   CMDLINE="$CMDLINE -h $JABBER_HOSTNAME"
fi
if [ x"$JABBER_SPOOL" != x"" ]; then
   CMDLINE="$CMDLINE -s $JABBER_SPOOL"
fi

if [ x"$CMDLINE" != x"" ]; then
   CMDLINE="-- $CMDLINE"
fi

set -e

case "$1" in
   start)
      
      check_pid
 
      echo -n "Starting $DESC: "
      [ ! -d `dirname $PID` ] && mkdir `dirname $PID`
      cd /usr/lib/jabber/
      start-stop-daemon -b -c jabber:adm --start --quiet \
         --pidfile $PID --exec $DAEMON $CMDLINE
      sleep 2
      if pidof $DAEMON > /dev/null 2>&1; then
         echo "$NAME."
         if [ -d /etc/jabber/jabber.d ]; then
            run-parts --arg=$1 /etc/jabber/jabber.d
         fi
      else
         echo -n "<Failed>"
         exit 1
      fi 
      ;;
   stop)
      echo -n "Stopping $DESC: "
      start-stop-daemon -o --stop --quiet --pidfile $PID\
         --retry 5 --exec $DAEMON || ( echo -n "<Failed>" && exit 1 )
      echo "$NAME."
      if [ -d /etc/jabber/jabber.d ]; then
         run-parts --arg=$1 /etc/jabber/jabber.d
      fi
      ;;
   reload|force-reload)
      echo "Reloading $DESC configuration files."
      start-stop-daemon --stop --signal 1 --quiet \
         --pidfile $PID --exec $DAEMON
      if [ -d /etc/jabber/jabber.d ]; then
         run-parts --arg=$1 /etc/jabber/jabber.d
      fi
      ;;
   restart)
      $0 stop
      sleep 3
      $0 start
      ;;
   *)
      N=/etc/init.d/$NAME
      echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
      exit 1
      ;;
esac

exit 0

Generated by  Doxygen 1.6.0   Back to index