]> git.pld-linux.org Git - packages/cups.git/blame - cups.init
This commit was manufactured by cvs2git to create tag 'cups-1_1_14-22'.
[packages/cups.git] / cups.init
CommitLineData
2f6a95a5 1#!/bin/sh
2#
2f6a95a5 3#
48216a6a 4# cups Common UNIX Printing System (CUPS)
2f6a95a5 5#
17b43d09 6# chkconfig: 235 95 00
48216a6a 7# description: Startup/shutdown script for the Common UNIX \
8# Printing System (CUPS).
2f6a95a5 9#
10
48216a6a 11# Source function library
12. /etc/rc.d/init.d/functions
2f6a95a5 13
48216a6a 14# Get network config
15. /etc/sysconfig/network
2f6a95a5 16
48216a6a 17# Get service config - may override defaults
18[ -f /etc/sysconfig/cups ] && . /etc/sysconfig/cups
2f6a95a5 19
48216a6a 20# Check that networking is up.
168d236f 21if is_no "${NETWORKING}"; then
22 msg_network_down CUPS
23 exit 1
48216a6a 24fi
2f6a95a5 25
48216a6a 26# See how we were called.
27case "$1" in
28 start)
29 # Check if the service is already running?
f6feb0d3 30 if [ ! -f /var/lock/subsys/cupsd ]; then
48216a6a 31 msg_starting CUPS
78986dfa 32 daemon cupsd -c /etc/cups/cupsd.conf
48216a6a 33 RETVAL=$?
f6feb0d3 34 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cupsd
48216a6a 35 else
44be047c 36 msg_already_running CUPS
168d236f 37 exit 1
48216a6a 38 fi
168d236f 39 ;;
48216a6a 40 stop)
168d236f 41 # Stop daemons.
f6feb0d3 42 if [ -f /var/lock/subsys/cupsd ]; then
48216a6a 43 msg_stopping CUPS
44 killproc cupsd
f6feb0d3 45 rm -f /var/lock/subsys/cupsd >/dev/null 2>&1
48216a6a 46 else
44be047c 47 msg_not_running CUPS
168d236f 48 exit 1
48216a6a 49 fi
168d236f 50 ;;
48216a6a 51 restart)
168d236f 52 $0 stop
48216a6a 53 $0 start
168d236f 54 ;;
55 reload)
f6feb0d3 56 if [ -f /var/lock/subsys/cupsd ]; then
e5676d4c 57 msg_reloading CUPS
168d236f 58 busy
48216a6a 59 killproc cupsd -HUP
48216a6a 60 else
168d236f 61 msg_not_running CUPS
62 exit 1
48216a6a 63 fi
64 ;;
168d236f 65 force-reload)
66 # if program allows reloading without stopping
67 $0 reload
68 exit $?
69
70 # or if it doesn't
71 $0 stop && $0 start
72 exit $?
73 ;;
48216a6a 74 status)
f6feb0d3 75 status cupsd
48216a6a 76 exit $?
168d236f 77 ;;
48216a6a 78 *)
168d236f 79 # show "Usage: %s {start|stop|status|restart|reload|force-reload}" $0
80 msg_usage "$0 {start|stop|status|restart|reload|force-reload}"
81 exit 1
48216a6a 82esac
2f6a95a5 83
48216a6a 84exit $RETVAL
This page took 0.049787 seconds and 4 git commands to generate.