]> git.pld-linux.org Git - packages/LPRng.git/blame - LPRng.init
- cleaning
[packages/LPRng.git] / LPRng.init
CommitLineData
03de21a2 1#!/bin/sh
2#
3# LPRng This shell script takes care of starting and stopping
4# LPRng lpd (printer daemon).
5#
6# chkconfig: 2345 60 60
7#
8# description: LPRng 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.
aece03f3 25if is_yes "${NETWORKING}"; then
26 if [ ! -f /var/lock/subsys/network ]; then
27 msg_network_down LPRng
28 exit 1
29 fi
30else
31 exit 0
03de21a2 32fi
33
34# Sanity check
35[ -f /etc/printcap ] || exit 0
36
37
38# See how we were called.
39case "$1" in
40 start)
41 # Check if the service is already running?
42 if [ ! -f /var/lock/subsys/lpd ]; then
43 msg_starting LPRng
44 daemon lpd
45 RETVAL=$?
46 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lpd
47 else
2b575342 48 msg_already_running "LPRng"
03de21a2 49 exit 1
50 fi
aece03f3 51 ;;
03de21a2 52 stop)
53 if [ -f /var/lock/subsys/lpd ]; then
54 msg_stopping "LPRng"
55 killproc lpd
56 rm -f /var/lock/subsys/lpd >/dev/null 2>&1
57 else
2b575342 58 msg_not_running "LPRng"
03de21a2 59 exit 1
60 fi
aece03f3 61 ;;
03de21a2 62 status)
63 status lpd
64 exit $?
65 ;;
66 restart|reload)
67 $0 stop
68 $0 start
69 ;;
70 *)
aece03f3 71 msg_usage "$0 {start|stop|restart|reload|status}"
72 exit 1
03de21a2 73esac
74
75exit $RETVAL
This page took 0.035035 seconds and 4 git commands to generate.