#!/bin/sh
# Begin /etc/init.d/cups

### BEGIN INIT INFO
# Provides:            cups
# Required-Start:      $network
# Should-Start:        $remote_fs haldaemon
# Required-Stop:       $network
# Should-Stop:         $remote_fs haldaemon
# Default-Start:       3 4 5 
# Default-Stop:        0 1 2 6
# Short-Description:   Starts/Stops the Common UNIX Printing System.
# Description:         Starts and stops the Common UNIX Printing System's
#                      cupsd daemon.
# X-LFS-Provided-By:   BLFS
### END INIT INFO

. /lib/lsb/init-functions

BIN_FILE="/usr/sbin/cupsd"
MESSAGE="Commun UNIX Printing System..."

chk_stat

case $1 in
    start)
        start_daemon "${BIN_FILE}"
                evaluate_retval start
        ;;

    stop)
        killproc "${BIN_FILE}"
                evaluate_retval stop
        ;;

        # force-reload is no different than reload for applications
        # that support a regular reload.
    force-reload | reload)
        killproc "${BIN_FILE}" -HUP
        evaluate_retval reload
        ;;

    restart)
        killproc "${BIN_FILE}"
        sleep 1
        start_daemon "${BIN_FILE}"
                evaluate_retval restart
        ;;

    status)
        statusproc
        ;;

    *)
        echo "Usage: $0 {start|stop|force-reload|reload|restart|status}"
        exit 1
        ;;
esac

# End /etc/init.d/cups
