Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 927b2e27eb4d289c88ad87f4a2fdfa8f > files > 16

dovecot-1.0.7-9.el5_11.4.src.rpm

#!/bin/bash
#
#	/etc/rc.d/init.d/dovecot
#
# Starts the dovecot daemon
#
# chkconfig: - 65 35
# description: Dovecot Imap Server
# processname: dovecot
# config: /etc/dovecot.conf
# config: /etc/sysconfig/dovecot
# pidfile: /var/run/dovecot/master.pid

### BEGIN INIT INFO
# Provides: dovecot
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start: $remote_fs
# Should-Stop: $remote_fs
# Default-Start: 
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: start and stop Dovecot Imap server
# Description: Dovecot is an IMAP server for Linux/UNIX-like systems,
#              written with security primarily in mind.  It also contains
#              a small POP3 server.
### END INIT INFO

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

if [ -f /etc/sysconfig/dovecot ]; then
    . /etc/sysconfig/dovecot
fi

RETVAL=0
prog="Dovecot Imap"
exec="/usr/sbin/dovecot"
config="/etc/dovecot.conf"
pidfile="/var/run/dovecot/master.pid"
lockfile="/var/lock/subsys/dovecot"

start() {
	[ -x $exec ] || exit 5
	[ -f $config ] || exit 6

        echo -n $"Starting $prog: "
	daemon --pidfile $pidfile $exec $OPTIONS
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch  $lockfile
	echo
}

stop() {
	echo -n $"Stopping $prog: "
	killproc -p $pidfile $exec
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f $lockfile
	echo
}

reload() {
	echo -n $"Reloading $prog: "
	killproc -p $pidfile $exec -HUP
	RETVAL=$?
	echo
}

#
#	See how we were called.
#
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  reload)
	reload
	;;
  force-reload|restart)
	stop
	start
	RETVAL=$?
	;;
  condrestart|try-restart)
	if [ -f $lockfile ]; then
	    stop
	    start
	fi
	;;
  status)
	status -p $pidfile $exec
	RETVAL=$?
	;;
  *)
	echo $"Usage: $0 {condrestart|try-restart|start|stop|restart|reload|force-reload|status}"
	exit 2
esac

exit $RETVAL