]> git.pld-linux.org Git - packages/cups.git/blame - cups.init
- preffer openssl over gnutls/cdsassl; br: openldap-devel
[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).
558087cd 9# processname: cupsd
2f6a95a5 10#
11
48216a6a 12# Source function library
13. /etc/rc.d/init.d/functions
2f6a95a5 14
48216a6a 15# Get network config
16. /etc/sysconfig/network
2f6a95a5 17
48216a6a 18# Get service config - may override defaults
19[ -f /etc/sysconfig/cups ] && . /etc/sysconfig/cups
2f6a95a5 20
48216a6a 21# Check that networking is up.
b4cbd825 22if is_yes "${NETWORKING}"; then
e53ab601 23 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
b4cbd825 24 msg_network_down CUPS
25 exit 1
26 fi
27else
28 exit 0
48216a6a 29fi
2f6a95a5 30
26e4a0de 31RETVAL=0
48216a6a 32# See how we were called.
33case "$1" in
34 start)
35 # Check if the service is already running?
4070cf70 36 if [ ! -f /var/lock/subsys/cups ]; then
48216a6a 37 msg_starting CUPS
78986dfa 38 daemon cupsd -c /etc/cups/cupsd.conf
48216a6a 39 RETVAL=$?
4070cf70 40 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/cups
48216a6a 41 else
44be047c 42 msg_already_running CUPS
48216a6a 43 fi
5995ec5d 44 ;;
48216a6a 45 stop)
5995ec5d 46 # Stop daemons.
4070cf70 47 if [ -f /var/lock/subsys/cups ]; then
48216a6a 48 msg_stopping CUPS
49 killproc cupsd
4070cf70 50 rm -f /var/lock/subsys/cups >/dev/null 2>&1
48216a6a 51 else
44be047c 52 msg_not_running CUPS
035f0970 53 fi
5995ec5d 54 ;;
48216a6a 55 restart)
5995ec5d 56 $0 stop
48216a6a 57 $0 start
26e4a0de 58 exit $?
5995ec5d 59 ;;
26e4a0de 60 reload|force-reload)
4070cf70 61 if [ -f /var/lock/subsys/cups ]; then
e5676d4c 62 msg_reloading CUPS
48216a6a 63 killproc cupsd -HUP
b4cbd825 64 RETVAL=$?
48216a6a 65 else
26e4a0de 66 msg_not_running CUPS >&2
67 exit 7
48216a6a 68 fi
69 ;;
48216a6a 70 status)
0f02d80d 71 status cups cupsd
48216a6a 72 exit $?
5995ec5d 73 ;;
48216a6a 74 *)
5995ec5d 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.049761 seconds and 4 git commands to generate.