File courier-authdaemon.init of Package courier-authlib

#! /bin/sh
# Copyright (c) 2005 SUSE LINUX Products Gmbh, Nuernberg, Germany.
# All rights reserved.
#
# Author: Thorsten Kukuk
#
# /etc/init.d/courier-authdaemon
#
### BEGIN INIT INFO
# Provides:          courier-authdaemon
# Required-Start:    $syslog $remote_fs
# Should-Start:
# Required-Stop:     $syslog $remote_fs
# Should-Stop:       courier-imap courier-imap-ssl courier-pop courier-pop-ssl
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: Courier-IMAP Authentication server
# Description:       Start the Courier-IMAP Authentication server,
#                    which handles the user authentication for the
#                    Courier IMAP and POP3 daemons.
### END INIT INFO

# Check for missing binaries
test -x /usr/lib/courier-authlib/authdaemond || exit 5

. /etc/rc.status

# Read configuration
. /etc/authlib/authdaemonrc

# Reset status of this service
rc_reset

case "$1" in
    start)
	echo -n "Starting Courier Authentication Daemon "
	/usr/sbin/courierlogger -pid=/var/run/authdaemon.courier-imap/pid $LOGGEROPTS -start /usr/lib/courier-authlib/authdaemond

	# remeber status and be verbose
	rc_status -v
	;;
    stop)
	echo -n "Shutting down Courier Authentication Daemon "
	/usr/sbin/courierlogger -pid=/var/run/authdaemon.courier-imap/pid $LOGGEROPTS -stop /usr/lib/courier-authlib/authdaemond

	# remeber status and be verbose
	rc_status -v
	;;
    try-restart)
	$0 status >/dev/null &&  $0 restart

	# remeber status
	rc_status
	;;
    restart)
	$0 stop
	$0 start

	# remeber status
	rc_status
	;;
    force-reload)
	$0 stop  &&  $0 start

	# remeber status
	rc_status
	;;
    reload)
	echo -n "Reload Courier Authentication Daemon "
	rc_failed 3

	# remeber status and be verbose
	rc_status -v
	;;
    status)
	echo -n "Checking for Courier Authentication Daemon "
	checkproc /usr/lib/courier-authlib/authdaemond

	# remeber status and be verbose
	rc_status -v
	;;
    probe)
	test /etc/authlib/authdaemonrc -nt /var/run/authdaemon.courier-imap/pid && echo restart
	;;
    *)
	echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
	exit 1
	;;
esac
rc_exit
openSUSE Build Service is sponsored by