X-Git-Url: https://git.pld-linux.org/?a=blobdiff_plain;f=cups.init;h=0cfa5b2577d133213fa0bf9b6ec3c2cdfbe981f6;hb=cb9c6c2f466abbe5b84aba20dd3e6c195aef8980;hp=cee80391a9093a69e1316ae6bd19d00a7171e557;hpb=0f02d80d6b0c026269b672047dd95e0ad6e4774b;p=packages%2Fcups.git diff --git a/cups.init b/cups.init index cee8039..0cfa5b2 100644 --- a/cups.init +++ b/cups.init @@ -1,11 +1,11 @@ #!/bin/sh # -# # cups Common UNIX Printing System (CUPS) # # chkconfig: 2345 90 10 # description: Startup/shutdown script for the Common UNIX \ # Printing System (CUPS). +# processname: cupsd # # Source function library @@ -27,51 +27,64 @@ else exit 0 fi +start() { + # Check if the service is already running? + if [ -f /var/lock/subsys/cups ]; then + msg_already_running CUPS + return + fi + + msg_starting CUPS + daemon /usr/sbin/cupsd -c /etc/cups/cupsd.conf + RETVAL=$? + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cups +} + +stop() { + # Stop daemons. + if [ ! -f /var/lock/subsys/cups ]; then + msg_not_running CUPS + return + fi + + msg_stopping CUPS + killproc cupsd + rm -f /var/lock/subsys/cups >/dev/null 2>&1 +} + +reload() { + if [ ! -f /var/lock/subsys/cups ]; then + msg_not_running CUPS + RETVAL=7 + return + fi + + msg_reloading CUPS + killproc cupsd -HUP + RETVAL=$? +} + RETVAL=0 # See how we were called. case "$1" in start) - # Check if the service is already running? - if [ ! -f /var/lock/subsys/cups ]; then - msg_starting CUPS - daemon cupsd -c /etc/cups/cupsd.conf - RETVAL=$? - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cups - else - msg_already_running CUPS - fi + start ;; stop) - # Stop daemons. - if [ -f /var/lock/subsys/cups ]; then - msg_stopping CUPS - killproc cupsd - rm -f /var/lock/subsys/cups >/dev/null 2>&1 - else - msg_not_running CUPS - fi + stop ;; restart) - $0 stop - $0 start - exit $? + stop + start ;; reload|force-reload) - if [ -f /var/lock/subsys/cups ]; then - msg_reloading CUPS - killproc cupsd -HUP - RETVAL=$? - else - msg_not_running CUPS >&2 - exit 7 - fi + reload ;; status) status cups cupsd exit $? ;; *) - # show "Usage: %s {start|stop|restart|reload|force-reload|status}" msg_usage "$0 {start|stop|restart|reload|force-reload|status}" exit 3 esac