[Pkg-sysvinit-commits] r255 - in sysvinit/trunk/debian: .
initscripts/etc/init.d
Thomas Hood
jdthood-guest at costa.debian.org
Thu Nov 24 17:15:04 UTC 2005
Author: jdthood-guest
Date: 2005-11-24 17:15:03 +0000 (Thu, 24 Nov 2005)
New Revision: 255
Added:
sysvinit/trunk/debian/fscklog.sh
Modified:
sysvinit/trunk/debian/changelog
sysvinit/trunk/debian/control
sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh
sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
sysvinit/trunk/debian/rules
Log:
Save fsck log
Modified: sysvinit/trunk/debian/changelog
===================================================================
--- sysvinit/trunk/debian/changelog 2005-11-24 16:10:25 UTC (rev 254)
+++ sysvinit/trunk/debian/changelog 2005-11-24 17:15:03 UTC (rev 255)
@@ -12,6 +12,7 @@
* checkroot.sh: Fix double printing of 'Done checking root file system';
mountall.sh: Fix chopped-up printing of mount information
(Closes: #339979, #331397 and presumably closes: #332309)
+ * Save fsck log (Closes: #189356)
* Improve initscripts' use of log_* functions (Closes: #55143, #323749)
* There remains the problem that error messages printed by programs
that are called by initscripts get printed on the console and thus
Modified: sysvinit/trunk/debian/control
===================================================================
--- sysvinit/trunk/debian/control 2005-11-24 16:10:25 UTC (rev 254)
+++ sysvinit/trunk/debian/control 2005-11-24 17:15:03 UTC (rev 255)
@@ -31,7 +31,7 @@
Package: initscripts
Architecture: any
-Depends: ${shlibs:Depends}, ${glibc:Depends}, dpkg (>= 1.9.0), ${mount:Depends}, util-linux (>= 2.9t-2), e2fsprogs (>= 1.19-1), coreutils (>= 5.0.91-2), debianutils (>= 2.13.1), lsb-base (>= 3.0-6)
+Depends: ${shlibs:Depends}, ${glibc:Depends}, dpkg (>= 1.9.0), ${mount:Depends}, util-linux (>= 2.9t-2), e2fsprogs (>= 1.32+1.33-WIP-2003.04.14-1), coreutils (>= 5.0.91-2), debianutils (>= 2.13.1), lsb-base (>= 3.0-6)
Replaces: sysvinit (<< 2.85-12), libc6, libc6.1, libc0.1, libc0.3
Conflicts: kbd (<< 0.95-2), mdutils (<< 0.35-9), sysv-rc (<< 2.86.ds1-1.2)
Description: Standard scripts needed for booting and shutting down
Added: sysvinit/trunk/debian/fscklog.sh
===================================================================
--- sysvinit/trunk/debian/fscklog.sh 2005-11-24 16:10:25 UTC (rev 254)
+++ sysvinit/trunk/debian/fscklog.sh 2005-11-24 17:15:03 UTC (rev 255)
@@ -0,0 +1,18 @@
+#!/bin/sh
+# fscklog.sh See if we need to rotate the fsck logs
+#
+
+MAXSIZE=51200
+NUMFILES=5
+export BOOTLOGFILE=/var/log/fsck/boot.log
+export ROOTLOGFILE=/var/log/fsck/root.log
+
+if [ -f "$BOOTLOGFILE" ] && [ "$(stat -c %s $BOOTLOGFILE)" -gt "$MAXSIZE" ]
+then
+ savelog -g adm -m 640 -u root -c $NUMFILES $BOOTLOGFILE
+fi
+
+if [ -f "$ROOTLOGFILE" ] && [ "$(stat -c %s $ROOTLOGFILE)" -gt "$MAXSIZE" ]
+then
+ savelog -g adm -m 640 -u root -c $NUMFILES $ROOTLOGFILE
+fi
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh 2005-11-24 16:10:25 UTC (rev 254)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkfs.sh 2005-11-24 17:15:03 UTC (rev 255)
@@ -55,6 +55,14 @@
;;
esac
[ `uname -m` = s390 ] && spinner="" # This should go away
+ FSCKTYPES_OPT=""
+ [ "$FSCKTYPES" ] && FSCKTYPES_OPT="-t $FSCKTYPES"
+ handle_failed_fsck() {
+ log_failure_msg "File system check failed. Please repair manually."
+ log_failure_msg "CONTROL-D will terminate this shell and continue system startup."
+ # Start a single user shell on the console
+ /sbin/sulogin $CONSOLE
+ }
if [ "$VERBOSE" != no ]
then
if [ "$FSCKTYPES" ]
@@ -63,18 +71,25 @@
else
log_action_msg "Will now check all file systems"
fi
- fi
- FSCKTYPES_OPT=""
- [ "$FSCKTYPES" ] && FSCKTYPES_OPT="-t $FSCKTYPES"
- fsck $spinner -T -R -A $fix $force $FSCKTYPES_OPT
- if [ $? -gt 1 ]
- then
- log_failure_msg "File system check failed. Please repair manually."
- log_failure_msg "CONTROL-D will terminate this shell and continue system startup."
- # Start a single user shell on the console
- /sbin/sulogin $CONSOLE
+ logsave -s /var/log/fsck/boot.log fsck $spinner -V -R -A $fix $force $FSCKTYPES_OPT
+ FSCKCODE=$?
+ if [ "$FSCKCODE" -gt 1 ]
+ then
+ handle_failed_fsck
+ else
+ log_success_msg "Done checking file systems."
+ fi
else
- [ "$VERBOSE" != no ] && log_success_msg "Done checking file systems."
+ log_action_begin_msg "Checking file systems"
+ logsave -s /var/log/fsck/boot.log fsck $spinner -T -R -A $fix $force $FSCKTYPES_OPT
+ FSCKCODE=$?
+ if [ "$FSCKCODE" -gt 1 ]
+ then
+ log_action_end_msg 1
+ handle_failed_fsck
+ else
+ log_action_end_msg 0
+ fi
fi
fi
rm -f /fastboot /forcefsck
Modified: sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh
===================================================================
--- sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh 2005-11-24 16:10:25 UTC (rev 254)
+++ sysvinit/trunk/debian/initscripts/etc/init.d/checkroot.sh 2005-11-24 17:15:03 UTC (rev 255)
@@ -119,13 +119,19 @@
then
if [ "$VERBOSE" != no ]
then
- log_action_begin_msg "Activating swap"
- SWAPON_MESSAGES="$(swapon -a 2>/dev/null)"
+ log_action_msg "Will now activate swap"
+ swapon -a
ES=$?
- [ "$SWAPON_MESSAGES" ] && log_action_cont_msg "(${SWAPON_MESSAGES})"
- log_action_end_msg $ES
+ if [ "$ES" = 0 ]
+ then
+ log_success_msg "Done activating swap."
+ else
+ log_failure_msg "Swap activation failed with error code ${ES}."
+ fi
else
- swapon -a 2>/dev/null
+ log_action_being_msg "Activating swap"
+ swapon -a >/dev/null 2>&1
+ log_action_end_msg $?
fi
fi
@@ -246,14 +252,23 @@
then
spinner=""
fi
- log_action_msg "Will now check root file system"
- fsck $spinner $force $fix -T -t $roottype $rootdev
- FSCKCODE=$?
- if [ "$FSCKCODE" = 0 ]
+
+ if [ "$VERBOSE" != no ]
then
- log_success_msg "Done checking root file system."
+ log_action_msg "Will now check root file system"
+ logsave -s /var/log/fsck/root.log fsck $spinner $force $fix -V -t $roottype $rootdev
+ FSCKCODE=$?
+ if [ "$FSCKCODE" = 0 ]
+ then
+ log_success_msg "Done checking root file system."
+ else
+ log_failure_msg "Root file system check failed with error code ${FSCKCODE}."
+ fi
else
- log_failure_msg "Root file system check failed with error code ${FSCKCODE}."
+ log_action_begin_msg "Checking root file system"
+ logsave -s /var/log/fsck/root.log fsck $spinner $force $fix -T -t $roottype $rootdev
+ FSCKCODE=$?
+ log_action_end_msg $FSCKCODE
fi
fi
Modified: sysvinit/trunk/debian/rules
===================================================================
--- sysvinit/trunk/debian/rules 2005-11-24 16:10:25 UTC (rev 254)
+++ sysvinit/trunk/debian/rules 2005-11-24 17:15:03 UTC (rev 255)
@@ -49,6 +49,7 @@
install -d -g root -m 755 -o root $(tmp)/usr/share
install -d -g root -m 755 -o root $(tmp)/usr/share/sysvinit
install -d -g root -m 755 -o root $(tmp)/usr/include
+ install -d -g adm -m 750 -o root $(tmp)/var/log/fsck
install -d -g root -m 755 -o root $(tmp)$(doc)/sysvinit
install -g root -m 644 doc/Changelog $(tmp)$(doc)/sysvinit/changelog
install -g root -m 644 debian/changelog \
More information about the Pkg-sysvinit-commits
mailing list