rc-scripts/trunk/rc.d/rc.sysinit

glen cvs at pld-linux.org
Fri Feb 24 12:04:59 CET 2006


Author: glen
Date: Fri Feb 24 12:04:56 2006
New Revision: 7006

Modified:
   rc-scripts/trunk/rc.d/rc.sysinit
Log:
Boot logging possibility with showconsole.

Modified: rc-scripts/trunk/rc.d/rc.sysinit
==============================================================================
--- rc-scripts/trunk/rc.d/rc.sysinit	(original)
+++ rc-scripts/trunk/rc.d/rc.sysinit	Fri Feb 24 12:04:56 2006
@@ -39,6 +39,13 @@
 	HOSTNAME=localhost
 fi
 
+# boot logging to /var/log/boot.msg. install showconsole package to get it.
+if [ -x /sbin/blogd ] && ! is_no "$RC_BOOTLOG"; then
+	RC_BOOTLOG=1
+else
+	RC_BOOTLOG=
+fi
+
 # Read system config data
 if [ -r /etc/sysconfig/system ]; then
 	. /etc/sysconfig/system
@@ -124,6 +131,7 @@
 	fi
 fi
 
+
 # Print welcome message
 nls "\t\t\t%sPowered by %sPLD Linux Distribution%s" "$(termput setaf $CPOWEREDBY)" "$(termput setaf $CPLD)" "$(termput op)"
 if ! is_no "$RC_PROMPT"; then
@@ -170,6 +178,11 @@
 		mount -n -t cpuset none /dev/cpuset
 	fi
 
+   # Start logging console output since we have all /dev stuff setup
+	if [ "$RC_BOOTLOG" ]; then
+		/sbin/blogd -q
+	fi
+
 	# Configure Linux kernel (initial configuration, some required modules still
 	# may be missing).
 	/sbin/sysctl -e -p /etc/sysctl.conf > /dev/null 2>&1
@@ -383,6 +396,12 @@
 			[ -r $file ] && restorecon $file >/dev/null 2>&1
 		done
 	fi
+
+else
+	# Start logging console output since we have all /dev stuff setup
+	if [ "$RC_BOOTLOG" ]; then
+		/sbin/blogd -q
+	fi
 fi
 
 # Remove stale backups
@@ -750,6 +769,11 @@
 		ok
 	fi
 
+	# /var/log should be writable now, so starting saving the boot output
+	if [ "$RC_BOOTLOG" ]; then
+		echo > /var/log/boot.msg
+		killall -IO blogd
+	fi
 
 	if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
 		run_cmd "Checking filesystem quotas" /sbin/quotacheck -vnugRa
@@ -785,9 +809,16 @@
 	# ... and here finish configuring parameters
 	/sbin/sysctl -e -p /etc/sysctl.conf > /dev/null 2>&1
 else
+	# /var/log should be writable now, so starting saving the boot output
+	if [ "$RC_BOOTLOG" ]; then
+		echo > /var/log/boot.msg
+		killall -IO blogd
+	fi
+
 	clean_vserver_mtab
 fi
 
+
 [ -n "$SELINUX" ] && [ -f /.autorelabel ] && relabel_selinux
 
 # Clean up /.


More information about the pld-cvs-commit mailing list