]> git.pld-linux.org Git - packages/LPRng.git/commitdiff
- new init sript for LPRng.
authorkloczek <kloczek@pld-linux.org>
Wed, 12 Apr 2000 22:52:43 +0000 (22:52 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    LPRng.init -> 1.1

LPRng.init [new file with mode: 0644]

diff --git a/LPRng.init b/LPRng.init
new file mode 100644 (file)
index 0000000..8fadb82
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+#
+# LPRng                This shell script takes care of starting and stopping
+#              LPRng lpd (printer daemon).
+#
+# chkconfig:   2345 60 60
+#
+# description: LPRng lpd is the print daemon required for lpr to work properly. \
+#              It is basically a server that arbitrates print jobs to printer(s).
+#
+# processname: lpd
+# config:      /etc/printcap
+
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Get service config
+[ -f /etc/sysconfig/lpd ] && . /etc/sysconfig/lpd
+
+# Check that networking is up.
+if [ "${NETWORKING}" = "no" ]; then
+       echo "WARNING: Networking is down. LPRng lpd can't be runed."
+       exit 1
+fi
+
+# Sanity check
+[ -f /etc/printcap ] || exit 0
+
+
+# See how we were called.
+case "$1" in
+  start)
+       # Check if the service is already running?
+       if [ ! -f /var/lock/subsys/lpd ]; then
+               msg_starting LPRng
+               daemon lpd
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/lpd
+       else
+               msg_Already_Running "LPRng"
+               exit 1
+       fi
+        ;;
+  stop)
+       if [ -f /var/lock/subsys/lpd ]; then
+               msg_stopping "LPRng"
+               killproc lpd
+               rm -f /var/lock/subsys/lpd >/dev/null 2>&1
+       else
+               msg_Not_Running "LPRng"
+               exit 1
+       fi
+        ;;
+  status)
+       status lpd
+       exit $?
+       ;;
+  restart|reload)
+       $0 stop
+       $0 start
+       ;;
+  *)
+        msg_Usage "$0 {start|stop|status|restart|reload}"
+        exit 1
+esac
+
+exit $RETVAL
This page took 0.081345 seconds and 4 git commands to generate.