]> git.pld-linux.org Git - packages/cups.git/blame - cups.init
- pl for backends
[packages/cups.git] / cups.init
CommitLineData
2f6a95a5 1#!/bin/sh
2#
2f6a95a5 3#
48216a6a 4# cups Common UNIX Printing System (CUPS)
2f6a95a5 5#
2549056c 6# chkconfig: 2345 90 10
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.
b4cbd825 21if is_yes "${NETWORKING}"; then
e53ab601 22 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
b4cbd825 23 msg_network_down CUPS
24 exit 1
25 fi
26else
27 exit 0
48216a6a 28fi
2f6a95a5 29
26e4a0de 30RETVAL=0
48216a6a 31# See how we were called.
32case "$1" in
33 start)
34 # Check if the service is already running?
4070cf70 35 if [ ! -f /var/lock/subsys/cups ]; then
48216a6a 36 msg_starting CUPS
78986dfa 37 daemon cupsd -c /etc/cups/cupsd.conf
48216a6a 38 RETVAL=$?
4070cf70 39 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cups
48216a6a 40 else
44be047c 41 msg_already_running CUPS
48216a6a 42 fi
5995ec5d 43 ;;
48216a6a 44 stop)
5995ec5d 45 # Stop daemons.
4070cf70 46 if [ -f /var/lock/subsys/cups ]; then
48216a6a 47 msg_stopping CUPS
48 killproc cupsd
4070cf70 49 rm -f /var/lock/subsys/cups >/dev/null 2>&1
48216a6a 50 else
44be047c 51 msg_not_running CUPS
48216a6a 52 fi
5995ec5d 53 ;;
48216a6a 54 restart)
5995ec5d 55 $0 stop
48216a6a 56 $0 start
26e4a0de 57 exit $?
5995ec5d 58 ;;
26e4a0de 59 reload|force-reload)
4070cf70 60 if [ -f /var/lock/subsys/cups ]; then
e5676d4c 61 msg_reloading CUPS
48216a6a 62 killproc cupsd -HUP
b4cbd825 63 RETVAL=$?
48216a6a 64 else
26e4a0de 65 msg_not_running CUPS >&2
66 exit 7
48216a6a 67 fi
68 ;;
48216a6a 69 status)
0f02d80d 70 status cups cupsd
48216a6a 71 exit $?
5995ec5d 72 ;;
48216a6a 73 *)
5995ec5d 74 # show "Usage: %s {start|stop|restart|reload|force-reload|status}"
75 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
26e4a0de 76 exit 3
48216a6a 77esac
2f6a95a5 78
48216a6a 79exit $RETVAL
This page took 0.099161 seconds and 4 git commands to generate.