wok annotate cyrus-sasl/stuff/etc/init.d/cyrus-sasl @ rev 5195

slitaz-doc: fix version for 3.0
author Christophe Lincoln <pankso@slitaz.org>
date Sun Mar 28 17:16:33 2010 +0200 (2010-03-28)
parents 25993750a8d7
children 7f188676b59c
rev   line source
pascal@1205 1 #!/bin/sh
pascal@1205 2 # /etc/init.d/cyrus-sasl : Start, stop and restart SASL server on SliTaz, at
pascal@1205 3 # boot time or with the command line.
pascal@1205 4 #
pascal@1205 5 # To start SASL server at boot time, just put cyrus-sasl in the $RUN_DAEMONS
pascal@1205 6 # variable of /etc/rcS.conf and configure options with /etc/daemons.conf
pascal@1205 7 #
pascal@1205 8 . /etc/init.d/rc.functions
pascal@1205 9 . /etc/daemons.conf
pascal@1205 10
pascal@1205 11 NAME=cyrus-sasl
pascal@1205 12 DESC="SASL server"
pascal@1205 13 DAEMON=/usr/sbin/saslauthd
pascal@1205 14 OPTIONS=$CYRUS_OPTIONS
pascal@1205 15 PIDFILE=/var/state/saslauthd/saslauthd.pid
pascal@1205 16 [ -n "$OPTIONS" ] || OPTIONS="-a shadow"
pascal@1205 17
pascal@1205 18 case "$1" in
pascal@1205 19 start)
pascal@2393 20 if active_pidfile $PIDFILE saslauthd ; then
pascal@1205 21 echo "$NAME already running."
pascal@1205 22 exit 1
pascal@1205 23 fi
pascal@1205 24 echo -n "Starting $DESC: $NAME... "
pascal@1205 25 $DAEMON $OPTIONS
pascal@1205 26 status
pascal@1205 27 ;;
pascal@1205 28 stop)
pascal@2393 29 if ! active_pidfile $PIDFILE saslauthd ; then
pascal@1205 30 echo "$NAME is not running."
pascal@1205 31 exit 1
pascal@1205 32 fi
pascal@1205 33 echo -n "Stopping $DESC: $NAME... "
pascal@1205 34 kill `cat $PIDFILE`
pascal@1205 35 status
pascal@1205 36 ;;
pascal@1205 37 restart)
pascal@2393 38 if ! active_pidfile $PIDFILE saslauthd ; then
pascal@1205 39 echo "$NAME is not running."
pascal@1205 40 exit 1
pascal@1205 41 fi
pascal@1205 42 echo -n "Restarting $DESC: $NAME... "
pascal@1205 43 kill `cat $PIDFILE`
pascal@1205 44 sleep 2
pascal@1205 45 $DAEMON $OPTIONS
pascal@1205 46 status
pascal@1205 47 ;;
pascal@1205 48 *)
pascal@1205 49 echo ""
pascal@1205 50 echo -e "\033[1mUsage:\033[0m /etc/init.d/`basename $0` [start|stop|restart]"
pascal@1205 51 echo ""
pascal@1205 52 exit 1
pascal@1205 53 ;;
pascal@1205 54 esac
pascal@1205 55
pascal@1205 56 exit 0