]> git.pld-linux.org Git - packages/LPRng.git/blob - lpd.init
- removed all Group fields translations (oure rpm now can handle translating
[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 if is_no "${NETWORKING}"; then
26         msg_Network_Down Lpd
27         exit 1
28 fi
29                         
30 # Sanity check
31 [ -f /etc/printcap ] || exit 1
32
33 # See how we were called.
34 case "$1" in
35   start)
36         # Check if the service is already running?
37         if [ ! -f /var/lock/subsys/lpd ]; then
38                 msg_starting Lpd
39                 daemon lpd
40                 RETVAL=$?
41                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lpd
42         else
43                 msg_Already_Running Lpd
44                 exit 1
45         fi
46         ;;
47   stop)
48         # Stop daemons.
49         if [ -f /var/lock/subsys/lpd ]; then
50                 msg_stopping Lpd
51                 killproc lpd
52                 rm -f /var/lock/subsys/lpd >/dev/null 2>&1
53         else
54                 msg_Not_Running Lpd
55                 exit 1
56         fi
57         ;;
58   status)
59         status lpd
60         exit $?
61         ;;
62   restart)
63         $0 stop
64         $0 start
65         ;;
66   *)
67         msg_Usage "$0 {start|stop|status|restart}"
68         exit 1
69 esac
70
71 exit $RETVAL
This page took 0.036437 seconds and 3 git commands to generate.