Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 653045d0d1eda517fbdb384de9b90aa4 > files > 11

exim-4.69-4mdv2010.0.i586.rpm

#!/bin/bash
#
# exim    This shell script takes care of starting and stopping exim
#
# chkconfig: 2345 80 30
# description: Exim is a Mail Transport Agent, which is the program \
#              that moves mail from one machine to another.
# processname: exim
# config: /etc/exim/exim.conf
# pidfile: /var/run/exim/exim.pid

### BEGIN INIT INFO
# Provides: exim
# Required-Start: $network
# Required-Stop: $network
# Should-Start: $named mysqld postgresql ldap greylistd
# Should-Stop: $named mysqld postgresql ldap greylistd
# Default-Start: 2 3 4 5
# Short-Description: Starts the exim daemons
# Description: Exim is a Mail Transport Agent, which is the program \
#              that moves mail from one machine to another.
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

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

# Source exim configureation.
if [ -f /etc/sysconfig/exim ] ; then
	. /etc/sysconfig/exim
else
	DAEMON=yes
	QUEUE=1h
fi

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

[ -f /usr/bin/exim ] || exit 0

start() {
        # Start daemons.
        echo -n "Starting exim: "
        daemon /usr/bin/exim $([ "$DAEMON" = yes ] && echo -bd) \
                              $([ -n "$QUEUE" ] && echo -q$QUEUE)
        RETVAL=$?
        echo
        [ $RETVAL = 0 ] && touch /var/lock/subsys/exim
}

stop() {
        # Stop daemons.
        echo -n "Shutting down exim: "
        killproc exim
	RETVAL=$?
        echo
        [ $RETVAL = 0 ] && rm -f /var/lock/subsys/exim
}

restart() {
	stop
	start
}

reload() {
        gprintf "Reloading exim configuration: "
        killproc exim -HUP
        retval=$?
        echo
        return $RETVAL
}

queue() {
	/usr/bin/exim -bp
}

doqueue() {
	echo "Forcing queue rescan... "
	/usr/bin/exim -qff
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart)
	restart
	;;
  reload)
	reload
	;;
  condrestart)
 	[ -f /var/lock/subsys/exim ] && restart || :
	;;
  status)
	status exim
	;;
  queue)
	queue
	;;
  doqueue)
	doqueue
	;;
  *)
	echo "Usage: exim {start|stop|restart|reload|status|condrestart|queue|doqueue}"
	exit 1
esac

exit $RETVAL