#!/bin/sh # # lpd This shell script takes care of starting and stopping # lpd (printer daemon). # # chkconfig: 2345 60 60 # # description: 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. [ "${NETWORKING}" = "no" ] && echo "Error: Networking is down"; exit 0 # 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 show Starting lpd daemon lpd else echo "lpd already is running" fi touch /var/lock/subsys/lpd ;; stop) show "Shutting down lpd" killproc lpd rm -f /var/lock/subsys/lpd ;; status) status lpd ;; restart|reload) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop|status|restart|reload}" exit 1 esac exit 0