From d45d2883404fb0e60021a9e222fcaf3979df442c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Poulsen?= Date: Sat, 19 Feb 2011 22:31:07 +0200 Subject: [PATCH] Added logging to initscripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Started bootlogd in rc.syslog to have logging during startup Signed-off-by: Søren Poulsen --- rc.multi | 3 ++- rc.single | 3 +++ rc.sysinit | 32 ++++++++++++++++++++++++++++---- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/rc.multi b/rc.multi index 660f649..ce9f1bd 100755 --- a/rc.multi +++ b/rc.multi @@ -23,7 +23,8 @@ done if [[ -x /etc/rc.local ]]; then /etc/rc.local fi - +touch /var/log/boot +kill $(ps -Cbootlogd -opid=) run_hook multi_end # vim: set ts=2 noet: diff --git a/rc.single b/rc.single index 4d22cf1..6f4cd15 100755 --- a/rc.single +++ b/rc.single @@ -54,5 +54,8 @@ if [[ $RUNLEVEL = 1 ]]; then exec /sbin/init -t1 S fi +touch /var/log/boot +kill $(ps -Cbootlogd -opid=) + # End of file # vim: set ts=2 noet: diff --git a/rc.sysinit b/rc.sysinit index 44c3eac..6e4a20a 100755 --- a/rc.sysinit +++ b/rc.sysinit @@ -6,10 +6,6 @@ . /etc/rc.conf . /etc/rc.d/functions -echo " " -printhl "Arch Linux\n" -printhl "${C_H2}http://www.archlinux.org" -printsep run_hook sysinit_start @@ -28,6 +24,34 @@ if ! /bin/mountpoint -q /dev; then fi fi +if [[ ! -d /dev/pts ]]; then + mkdir /dev/pts +fi + +#mount /dev/pts +/bin/mountpoint -q /dev/pts || /bin/mount -n -t devpts devpts /dev/pts -o nosuid,noexec + +#make static versions of /dev/ptmx, /dev/tty0 and /dev/tty1 for bootlogd +if [[ ! -c /dev/ptmx ]]; then + IFS=: read major minor < /sys/class/tty/ptmx/dev + mknod /dev/ptmx c $major $minor +fi +if [[ ! -c /dev/tty0 ]]; then + IFS=: read major minor < /sys/class/tty/tty0/dev + mknod /dev/tty0 c $major $minor +fi +if [[ ! -c /dev/tty1 ]]; then + IFS=: read major minor < /sys/class/tty/tty1/dev + mknod /dev/tty1 c $major $minor +fi + + +/sbin/bootlogd -r +echo " " +printhl "Arch Linux\n" +printhl "${C_H2}http://www.archlinux.org" +printsep + # start up our mini logger until syslog takes over /sbin/minilogd -- 1.7.4.1