~ubuntu-branches/debian/experimental/sysvinit/experimental

« back to all changes in this revision

Viewing changes to debian/initscripts/etc/init.d/bootlogd

  • Committer: Bazaar Package Importer
  • Author(s): Petter Reinholdtsen
  • Date: 2009-09-13 00:13:49 UTC
  • Revision ID: james.westby@ubuntu.com-20090913001349-c4hnvhp0titxdpw9
Tags: 2.87dsf-5
* Uploading to experimental, to test the new build rules.

* Make sysv-rc postinst report detected problems to stderr too when
  failing to migrate.
* Fix typo in error message from postinst (Closes: #545409).
* Make initscripts depend on sysvinit-utils (>= 2.86.ds1-64), to
  make sure the fstab-decode program is available (Closes: #545356).
* Make sure the calls to 'update-rc.d X remove' in initscripts
  postinst do not ignore errors (Closes: #406361).
* Make sysvinit depend on sysvinit-utils (>= 2.86.ds1-66) to avoid
  that bootlogd disappear during partial upgrades (Closes: #545368).
* Restructure source package to make it possible to use debhelper in
  the common way to build the source, by moving debian/initscripts/
  and debian/sysv-rc/ into debian/src/.  Restructure build rules to
  use debhelper more, and migrate to debhelper 7.
* New patch 98_installtarget.patch to improve the sysvinit install
  target.
* Remove /etc/init.d/.depend.* in prerm, not postrm, to avoid
  surprises.
* Remove /var/lib/update-rc.d/* when the package is purged.
* Change cut-off point for the trimmed changelog entries in
  sysvinit-utils, initscripts and sysv-rc from version 2.84-3 to
  version 2.86.ds1-47, to reduce the package sizes.
* Drop hurd specific dependency on libc0.3 (>= 2.3.2.ds1-12).  It is
  no longer needed according to Michael Bunk.  Patch from Michael
  Biebl.
* Remove information about scripts in /var/lib/update-rc.d/ when
  their runlevel symlinks are removed (Closes: #545949).  Remove
  such files left behind earlier during upgrade.
* Bootlogd now starts as late as possible (Closes: #265801)
* Drop the binary /lib/init/readlink from initscripts and depend on
  coreutils (>= 5.93) instead.  Adjust scripts to use the program
  from coreutils from now on (Closes: #239342).
* Make sure insserv exit values propagate through update-rc.d to make
  sure packages with errors fail to install.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
### BEGIN INIT INFO
3
 
# Provides:          bootlogd
4
 
# Required-Start:    mountdevsubfs
5
 
# X-Start-Before:    hostname keymap keyboard-setup procps pcmcia hwclock hwclockfirst hdparm hibernate-clean
6
 
# Required-Stop:
7
 
# Default-Start:     S
8
 
# Default-Stop:
9
 
# Short-Description: Start or stop bootlogd.
10
 
# Description:       Starts or stops the bootlogd log program
11
 
#                    which logs boot messages.
12
 
### END INIT INFO
13
 
 
14
 
PATH=/sbin:/bin  # No remote fs at start
15
 
DAEMON=/sbin/bootlogd
16
 
[ -x "$DAEMON" ] || exit 0
17
 
NAME=bootlogd
18
 
DESC="boot logger"
19
 
BOOTLOGD_OPTS="-r -c"
20
 
[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
21
 
. /lib/init/vars.sh
22
 
 
23
 
. /lib/lsb/init-functions
24
 
 
25
 
# Because bootlogd is broken on some systems, we take the special measure
26
 
# of requiring it to be enabled by setting an environment variable.
27
 
case "$BOOTLOGD_ENABLE" in
28
 
  [Nn]*)
29
 
        exit 0
30
 
        ;;
31
 
esac
32
 
 
33
 
# Previously this script was symlinked as "stop-bootlogd" which, when run
34
 
# with the "start" argument, should stop bootlogd.  Now stop-bootlogd is
35
 
# a distinct script, but for backward compatibility this script continues
36
 
# to implement the old behavior.
37
 
SCRIPTNAME=${0##*/}
38
 
SCRIPTNAME=${SCRIPTNAME#[SK]??}
39
 
ACTION="$1"
40
 
case "$0" in
41
 
  *stop-bootlog*)
42
 
        [ "$ACTION" = start ] && ACTION=stop
43
 
        ;;
44
 
esac
45
 
 
46
 
case "$ACTION" in
47
 
  start)
48
 
        # PATH is set above
49
 
        log_daemon_msg "Starting $DESC" "$NAME"
50
 
        if [ -d /proc/1/. ]
51
 
        then
52
 
                umask 027
53
 
                start-stop-daemon --start --quiet --exec $DAEMON -- \
54
 
                        $BOOTLOGD_OPTS
55
 
                ES=$?
56
 
        else
57
 
                $DAEMON $BOOTLOGD_OPTS
58
 
                ES=$?
59
 
        fi
60
 
        log_end_msg $ES
61
 
        ;;
62
 
  stop)
63
 
        PATH=/bin:/sbin:/usr/bin:/usr/sbin
64
 
        log_daemon_msg "Stopping $DESC" "$NAME"
65
 
        start-stop-daemon --oknodo --stop --quiet --exec $DAEMON
66
 
        ES=$?
67
 
        sleep 1
68
 
        log_end_msg $ES
69
 
        if [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
70
 
        then
71
 
                [ "$VERBOSE" = no ] || log_action_begin_msg "Moving boot log file"
72
 
                # bootlogd writes to boot, making backup at boot~
73
 
                cd /var/log && {
74
 
                        chgrp adm boot || :
75
 
                        savelog -q -p -c 5 boot \
76
 
                        && mv boot.0 boot \
77
 
                        && mv boot~ boot.0
78
 
                }
79
 
                ES=$?
80
 
                [ "$VERBOSE" = no ] || log_action_end_msg $ES
81
 
        fi
82
 
        ;;
83
 
  restart|force-reload)
84
 
        /etc/init.d/bootlogd stop
85
 
        /etc/init.d/bootlogd start
86
 
        ;;
87
 
  status)
88
 
        status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
89
 
        ;;
90
 
  *)
91
 
        echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
92
 
        exit 3
93
 
        ;;
94
 
esac
95
 
 
96
 
: