#!/bin/sh
set -e

if [ -x /etc/init.d/bootlogd ]; then
    update-rc.d bootlogd             start 05 S . >/dev/null || exit $?
fi
if [ -x /etc/init.d/stop-bootlogd-single ]; then
    update-rc.d stop-bootlogd-single start 99 S . >/dev/null || exit $?
fi
if [ -x /etc/init.d/stop-bootlogd ]; then
    update-rc.d stop-bootlogd        start 99 2 3 4 5 . >/dev/null || exit $?
fi

#
# Create initial log files
#
for F in /var/log/boot
do
	if [ ! -f "$F" ] && touch "$F" >/dev/null 2>&1
	then
		echo "(Nothing has been logged yet.)" >| "$F"
		chown root:adm "$F"
		chmod 640 "$F"
	fi
done

#DEBHELPER#
