[Pkg-sysvinit-devel] Bug#678231: sysv-rc: please log filename of "obsolete init.d script"

Brian Warner warner at lothar.com
Wed Jun 20 17:58:47 UTC 2012


On 6/20/12 12:00 AM, Roger Leigh wrote:

>> That pinpointed the trouble to three files: bootlogd, stop-bootlogd,
>> and stop-bootlogd-single. I still don't understand what problem
>> they're causing, but I've got more information to go on now.
> 
> They probably lack an LSB header to specify their dependencies? It
> would be good to know if they are truly problematic. If you still have
> the files, if you could attach a copy here that would be great.

Sure (found a copy from a backup). They *do* have "BEGIN INIT INFO"
headers (I grepped for all files in /etc/init.d/ that lacked the
headers, while trying to track down the problem, and they did not appear
on that list). I also remember that the "dpkg-query -W
-f='${Conffiles}\n'" command (in sysv-rc.postinst) did report "obsolete"
for those three... I don't know what criteria that uses, though.

Here's the contents of "bootlogd":

==================== BEGIN /etc/init.d/bootlogd
#! /bin/sh
### BEGIN INIT INFO
# Provides:          bootlogd
# Required-Start:    mountdevsubfs
# X-Start-Before:    hostname keymap keyboard-setup procps pcmcia
hwclock hwclockfirst hdparm hibernate-cleanup lvm2
# Required-Stop:
# Default-Start:     S
# Default-Stop:
# Short-Description: Start or stop bootlogd.
# Description:       Starts or stops the bootlogd log program
#                    which logs boot messages.
### END INIT INFO

PATH=/sbin:/bin  # No remote fs at start
DAEMON=/sbin/bootlogd
[ -x "$DAEMON" ] || exit 0
NAME=bootlogd
DESC="boot logger"
BOOTLOGD_OPTS="-r -c"
[ -r /etc/default/bootlogd ] && . /etc/default/bootlogd
. /lib/init/vars.sh

. /lib/lsb/init-functions

# Because bootlogd is broken on some systems, we take the special measure
# of requiring it to be enabled by setting an environment variable.
case "$BOOTLOGD_ENABLE" in
  [Nn]*)
	exit 0
	;;
esac

# Previously this script was symlinked as "stop-bootlogd" which, when run
# with the "start" argument, should stop bootlogd.  Now stop-bootlogd is
# a distinct script, but for backward compatibility this script continues
# to implement the old behavior.
SCRIPTNAME=${0##*/}
SCRIPTNAME=${SCRIPTNAME#[SK]??}
ACTION="$1"
case "$0" in
  *stop-bootlog*)
	[ "$ACTION" = start ] && ACTION=stop
	;;
esac

case "$ACTION" in
  start)
  	# PATH is set above
	[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
	if [ -d /proc/1/. ]
	then
		umask 027
		start-stop-daemon --start --quiet --exec $DAEMON -- \
			$BOOTLOGD_OPTS
		ES=$?
	else
		$DAEMON $BOOTLOGD_OPTS
		ES=$?
	fi
	[ "$VERBOSE" != no ] && log_end_msg $ES
	;;
  stop)
	PATH=/bin:/sbin:/usr/bin:/usr/sbin
	[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
	start-stop-daemon --oknodo --stop --quiet --exec $DAEMON
	ES=$?
	sleep 1
	[ "$VERBOSE" != no ] && log_end_msg $ES
	if [ -f /var/log/boot ] && [ -f /var/log/boot~ ]
	then
		[ "$VERBOSE" = no ] || log_action_begin_msg "Moving boot log file"
		# bootlogd writes to boot, making backup at boot~
		cd /var/log && {
			chgrp adm boot || :
			savelog -q -p -c 5 boot \
			&& mv boot.0 boot \
			&& mv boot~ boot.0
		}
		ES=$?
		[ "$VERBOSE" = no ] || log_action_end_msg $ES
	fi
	;;
  restart|force-reload)
 	/etc/init.d/bootlogd stop
 	/etc/init.d/bootlogd start
	;;
  status)
	status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
	;;
  *)
	echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
	exit 3
	;;
esac

:

==================== END /etc/init.d/bootlogd

The other two files' headers are:

### BEGIN INIT INFO
# Provides:          stop-bootlogd
# Required-Start:    $local_fs $all
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:
# Short-Description: Stop bootlogd
# Description:       See the init.d/bootlogd script
### END INIT INFO

and

### BEGIN INIT INFO
# Provides:          stop-bootlogd-single
# Required-Start:    $local_fs $all
# Required-Stop:
# Default-Start:     S
# Default-Stop:
# Short-Description: Stop bootlogd in single user mode
# Description:       See the init.d/bootlogd script
### END INIT INFO

Deleting all three cleared up the problem.. my system is now running
with dependency-based boot.

cheers,
 -Brian





More information about the Pkg-sysvinit-devel mailing list