]> git.pld-linux.org Git - packages/LPRng.git/blob - lpd.init
- standarized reaction if NETWRKING=no.
[packages/LPRng.git] / lpd.init
1 #!/bin/sh
2 #
3 # lpd           This shell script takes care of starting and stopping
4 #               lpd (printer daemon).
5 #
6 # chkconfig:    2345 60 60
7 #
8 # description:  lpd is the print daemon required for lpr to work properly. \
9 #               It is basically a server that arbitrates print jobs to printer(s).
10 #
11 # processname:  lpd
12 # config:       /etc/printcap
13
14
15 # Source function library
16 . /etc/rc.d/init.d/functions
17
18 # Get network config
19 . /etc/sysconfig/network
20
21 # Get service config
22 [ -f /etc/sysconfig/lpd ] && . /etc/sysconfig/lpd
23
24 # Check that networking is up.
25 [ "${NETWORKING}" = "no" ] && echo "Error: Networking is down" && exit 0
26
27 # Sanity check
28 [ -f /etc/printcap ] || exit 0
29
30
31 # See how we were called.
32 case "$1" in
33   start)
34         # Check if the service is already running?
35         if [ ! -f /var/lock/subsys/lpd ]; then
36                 show Starting lpd
37                 daemon lpd
38         else
39                 echo "lpd already is running"
40         fi
41         touch /var/lock/subsys/lpd
42         ;;
43   stop)
44         show "Shutting down lpd"
45         killproc lpd
46         rm -f /var/lock/subsys/lpd
47         ;;
48   status)
49         status lpd
50         ;;
51   restart|reload)
52         $0 stop
53         $0 start
54         ;;
55   *)
56         echo "Usage: $0 {start|stop|status|restart|reload}"
57         exit 1
58 esac
59
60 exit 0
This page took 0.081256 seconds and 3 git commands to generate.