~ubuntu-branches/ubuntu/jaunty/lpr/jaunty

« back to all changes in this revision

Viewing changes to debian/init

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-03-15 14:54:38 UTC
  • Revision ID: james.westby@ubuntu.com-20030315145438-wvhdf01k99wvq846
Tags: 1:2000.05.07-4.3
* Non-maintainer upload by the Security Team
* Applied patch from SuSE to fix buffer overvlow and arbitrary file access

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
PATH=/bin:/usr/bin:/sbin:/usr/sbin
 
4
DAEMON=/usr/sbin/lpd
 
5
PIDFILE=/var/run/lpd.pid
 
6
 
 
7
test -x $DAEMON -a -f /usr/sbin/pac || exit 0
 
8
 
 
9
case "$1" in
 
10
  start)
 
11
        echo -n "Starting printer spooler: lpd"
 
12
        if start-stop-daemon --quiet --stop --signal 0 --pidfile $PIDFILE --name lpd
 
13
        then
 
14
                echo " already running."
 
15
                exit
 
16
        fi
 
17
        /sbin/start-stop-daemon --start --quiet --exec $DAEMON
 
18
        echo "."
 
19
        ;;
 
20
  stop)
 
21
        echo -n "Stopping printer spooler: lpd"
 
22
        if start-stop-daemon --quiet --stop --signal 0 --pidfile $PIDFILE --name lpd
 
23
        then
 
24
                PID=`cat $PIDFILE`
 
25
                start-stop-daemon --quiet --stop --exec $DAEMON --pidfile $PIDFILE --name lpd
 
26
                # Now we wait for it to die
 
27
                while kill -0 $PID 2>/dev/null; do sleep 1; done
 
28
                echo "."
 
29
        else
 
30
                echo " not running.";
 
31
        fi
 
32
        ;;
 
33
  force-reload|restart)
 
34
        $0 stop
 
35
        $0 start
 
36
        ;;
 
37
  *)
 
38
        echo "Usage: /etc/init.d/lpd {start|stop|restart|force-reload}"
 
39
        exit 1
 
40
esac
 
41
 
 
42
exit 0