SHA256
1
0
forked from pool/dovecot
dovecot/dovecot.init

95 lines
1.9 KiB
Bash

#! /bin/sh
# Copyright (c) 1995-2004 SUSE Linux AG, Nuernberg, Germany.
# 2005-2007 SUSE / Novell Inc.
# All rights reserved.
#
# Author: Mads Martin Joergensen <mmj@suse.de>
# Marcus Rueckert <mrueckert@suse.de>
# Please send feedback to http://www.suse.de/feedback/
#
# /etc/init.d/dovecot
# and its symbolic link
# /usr/sbin/rcdovecot
#
### BEGIN INIT INFO
# Provides: dovecot
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Should-Start: $named $time postgresql mysql ldap
# Should-Stop: postgresql mysql ldap
# X-Start-Before: exim postfix
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: Dovecot IMAP/POP3/SASL server
# Description: Dovecot IMAP/POP3/SASL server
### END INIT INFO
. /etc/rc.status
# Reset status of this service
rc_reset
DOVECOT_BIN=/usr/sbin/dovecot
test -x $DOVECOT_BIN || {
echo "$DOVECOT_BIN not installed";
if [ "$1" = "stop" ] ; then
exit 0
else
exit 5
fi
}
case "$1" in
start)
echo -n "Starting dovecot "
startproc $DOVECOT_BIN
rc_status -v
;;
stop)
echo -n "Stopping dovecot "
killproc -TERM $DOVECOT_BIN
rc_status -v
;;
try-restart|condrestart)
$0 status
if test $? = 0; then
$0 restart
else
rc_reset
fi
rc_status
;;
restart)
$0 stop
$0 start
rc_status
;;
force-reload)
# dovecot has support for reloading it's config when
# recieving signal 1 (SIGHUP). There's still some
# issues noticed in the dovecot-TODO though so restart
# for now.
echo -n "Reload service dovecot "
# killproc -HUP $DOVECOT_BIN
# rc_status -v
$0 try-restart
rc_status
;;
reload)
echo -n "Reload service dovecot "
killproc -HUP $DOVECOT_BIN
rc_status -v
;;
status)
echo -n "Checking for service dovecot "
checkproc $DOVECOT_BIN
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
rc_exit