File: bootlogd.init

package info (click to toggle)
sysvinit 2.86.ds1-38+etchnhalf.1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 1,268 kB
  • ctags: 655
  • sloc: ansic: 7,385; sh: 4,736; makefile: 405; perl: 244
file content (67 lines) | stat: -rwxr-xr-x 1,480 bytes parent folder | download | duplicates (10)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#! /bin/sh
#
# bootlogd	One of the first scripts to be executed. Starts or stops
#		the bootlogd log program. If this script is called as
#		"stop-bootlogd", it will stop the daemon instead of
#		starting it even when called with the "start" argument.
#
# Version:	@(#)bootlogd  2.77  24-Aug-1999  miquels@cistron.nl
#

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/sbin/bootlogd
NAME=bootlogd
DESC="Bootlog daemon"
PIDFILE=/var/run/$NAME.pid

test -f $DAEMON || exit 0

## set -e # not needed

. /etc/default/rcS

case "$0" in
	*stop-bootlog*)
		stopper=yes
		;;
esac

case "$1" in
	start|stop)
		if [ "$stopper" ] || [ "$1" = "stop" ]
		then
			echo -n "Stopping $DESC: "
			start-stop-daemon --stop --quiet --exec $DAEMON
		else
			echo -n "Starting $DESC: "
			start-stop-daemon --start --quiet --exec $DAEMON -- -r
		fi
		if [ "$stopper" ] && [ -f /var/log/boot.log ] && \
		   [ -f /var/log/boot.log~ ]
		then
			cd /var/log
			savelog -p -c 5 boot.log > /dev/null 2>&1
			mv boot.log.0 boot.log
			mv boot.log~ boot.log.0
		fi
		echo "$NAME."
		;;
	 restart|force-reload)
		echo -n "Restarting $DESC: "
		start-stop-daemon --stop --quiet --pidfile \
                	$PIDFILE --exec $DAEMON -- -p $PIDFILE
		sleep 1
		start-stop-daemon --start --quiet --pidfile \
			$PIDFILE --exec $DAEMON -- -p $PIDFILE
		echo "$NAME."
		;;
	*)
		N=${0##*/}
		N=${N#[SK]??}
		echo "Usage: $N {start|stop|restart|force-reload}" >&2
		exit 1
		;;
esac

exit 0