File: init

package info (click to toggle)
lpr 5.9-29hamm34
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 488 kB
  • ctags: 500
  • sloc: ansic: 6,005; makefile: 120; sh: 82
file content (35 lines) | stat: -rw-r--r-- 765 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh

DAEMON=/usr/sbin/lpd
DOC=/usr/doc/lpr

test -x $DAEMON -a -e $DOC || exit 0

case "$1" in
  start)
	echo -n "Starting printer spooler: lpd"
	start-stop-daemon --start --quiet --exec $DAEMON
	echo "."
	;;
  stop)
	echo -n "Stopping printer spooler: lpd"
	start-stop-daemon --stop --quiet --pidfile /var/run/lpd.pid --exec $DAEMON
	PID=$(pidof lpd)
	test -n "$PID" && kill $PID
	echo "."
	;;
  restart|force-reload)
	echo -n "Restarting printer spooler: lpd"
	start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/lpd.pid --exec $DAEMON
	PID=$(pidof lpd)
	test -n "$PID" && kill $PID
	sleep 2
	start-stop-daemon --start --quiet --exec $DAEMON
	echo "."
	;;
  *)
        echo "Usage: /etc/init.d/lpd {start|stop|restart}"
        exit 1
esac

exit 0