summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-core/sysvinit/sysvinit/bootlogd.init')
-rwxr-xr-xmeta/recipes-core/sysvinit/sysvinit/bootlogd.init85
1 files changed, 85 insertions, 0 deletions
diff --git a/meta/recipes-core/sysvinit/sysvinit/bootlogd.init b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
new file mode 100755
index 0000000000..f8f07a050f
--- /dev/null
+++ b/meta/recipes-core/sysvinit/sysvinit/bootlogd.init
@@ -0,0 +1,85 @@
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.85-12 21-Mar-2004 miquels@cistron.nl
9#
10
11PATH=/sbin:/bin:/usr/sbin:/usr/bin
12DAEMON=/sbin/bootlogd
13NAME=bootlogd
14DESC="Bootlog daemon"
15
16test -f $DAEMON || exit 0
17
18[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
19
20## set -e # not needed
21
22case "$BOOTLOGD_ENABLE" in
23 [Nn]*)
24 exit 0
25 ;;
26esac
27
28STOPPER=
29ACTION="$1"
30case "$0" in
31 *stop-bootlog*)
32 STOPPER=Y
33 if [ "$ACTION" = start ]
34 then
35 ACTION=stop
36 fi
37 ;;
38esac
39
40case "$ACTION" in
41 start)
42 echo -n "Starting $DESC: "
43 if [ -d /proc/1/. ]
44 then
45 umask 027
46 start-stop-daemon --start --quiet \
47 --exec $DAEMON -- -r
48 else
49 $DAEMON -r
50 fi
51 echo "$NAME."
52 ;;
53 stop)
54 echo -n "Stopping $DESC: "
55 start-stop-daemon --stop --quiet --exec $DAEMON
56
57 if [ "$STOPPER" ] && [ -f /var/log/boot ] && \
58 [ -f /var/log/boot~ ]
59 then
60 cd /var/log
61 chgrp adm boot
62 savelog -p -c 5 boot > /dev/null 2>&1
63 mv boot.0 boot
64 mv boot~ boot.0
65 fi
66
67 echo "$NAME."
68 ;;
69 restart|force-reload)
70 echo -n "Restarting $DESC: "
71 start-stop-daemon --stop --quiet --exec $DAEMON
72 sleep 1
73 start-stop-daemon --start --quiet --exec $DAEMON
74 echo "$NAME."
75 ;;
76 *)
77 N=${0##*/}
78 N=${N#[SK]??}
79 echo "Usage: $N {start|stop|restart|force-reload}" >&2
80 exit 1
81 ;;
82esac
83
84exit 0
85