]>
Commit | Line | Data |
---|---|---|
a74aeac6 PR |
1 | #! /bin/sh |
2 | # | |
3 | # bootlogd One of the first scripts to be executed. Starts or stops | |
4 | # the bootlogd log program. If this script is called as | |
5 | # "stop-bootlogd", it will stop the daemon instead of | |
6 | # starting it even when called with the "start" argument. | |
7 | # | |
8 | # Version: @(#)bootlogd 2.77 24-Aug-1999 miquels@cistron.nl | |
9 | # | |
10 | ||
11 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
12 | DAEMON=/sbin/bootlogd | |
13 | NAME=bootlogd | |
14 | DESC="Bootlog daemon" | |
15 | PIDFILE=/var/run/$NAME.pid | |
16 | ||
17 | test -f $DAEMON || exit 0 | |
18 | ||
19 | ## set -e # not needed | |
20 | ||
21 | . /etc/default/rcS | |
22 | ||
23 | case "$0" in | |
24 | *stop-bootlog*) | |
25 | stopper=yes | |
26 | ;; | |
27 | esac | |
28 | ||
29 | case "$1" in | |
30 | start|stop) | |
31 | if [ "$stopper" ] || [ "$1" = "stop" ] | |
32 | then | |
33 | echo -n "Stopping $DESC: " | |
34 | start-stop-daemon --stop --quiet --exec $DAEMON | |
35 | else | |
36 | echo -n "Starting $DESC: " | |
37 | start-stop-daemon --start --quiet --exec $DAEMON -- -r | |
38 | fi | |
39 | if [ "$stopper" ] && [ -f /var/log/boot.log ] && \ | |
40 | [ -f /var/log/boot.log~ ] | |
41 | then | |
42 | cd /var/log | |
43 | savelog -p -c 5 boot.log > /dev/null 2>&1 | |
44 | mv boot.log.0 boot.log | |
45 | mv boot.log~ boot.log.0 | |
46 | fi | |
47 | echo "$NAME." | |
48 | ;; | |
49 | restart|force-reload) | |
50 | echo -n "Restarting $DESC: " | |
51 | start-stop-daemon --stop --quiet --pidfile \ | |
52 | $PIDFILE --exec $DAEMON -- -p $PIDFILE | |
53 | sleep 1 | |
54 | start-stop-daemon --start --quiet --pidfile \ | |
55 | $PIDFILE --exec $DAEMON -- -p $PIDFILE | |
56 | echo "$NAME." | |
57 | ;; | |
58 | *) | |
59 | N=${0##*/} | |
60 | N=${N#[SK]??} | |
61 | echo "Usage: $N {start|stop|restart|force-reload}" >&2 | |
62 | exit 1 | |
63 | ;; | |
64 | esac | |
65 | ||
66 | exit 0 | |
67 |