From c392fef97b564badfd0e4d7e9181768034211d15 Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Sun, 17 Dec 2006 18:55:55 +0000 Subject: Improved "watchdog" for auto power off, if stage3 does not complete after around two minutes. Removed klibc stuff (ipconfig, nfsmount) which was never really in use (klibc is deprecated and the busybox approach seems much more promising to keep the initramfs small and flexible). Little cleanups ... git-svn-id: http://svn.openslx.org/svn/openslx/trunk@564 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/init | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'initramfs/initrd-stuff/init') diff --git a/initramfs/initrd-stuff/init b/initramfs/initrd-stuff/init index f29f10ba..13ea98ae 100755 --- a/initramfs/initrd-stuff/init +++ b/initramfs/initrd-stuff/init @@ -2,7 +2,7 @@ # main script for new type of initial ramdisk for OpenSLX linux diskless # clients version 4 # -# Dirk von Suchodoletz , 15-12-2006 +# Dirk von Suchodoletz , 17-12-2006 # (xenbr), 27-09-2006 # # (c) 2006 - RZ Universitaet Freiburg @@ -200,16 +200,18 @@ done # at this point a timer should be started to ensure an automated reboot # or halt of the machine if SLX init does not succeed (e.g. missing kernel # module for the network adaptor) -# fixme/testme!! -errorhalt () { if [ "${DEBUGLEVEL}" -lt 4 ] ; then - [ ! -f /proc/version ] && mount -n -t proc proc /proc - [ ! -f /proc/sysrq-trigger ] && echo -e $init_nosysrq - sleep 120 - echo "o" > /proc/sysrq-trigger + [ -x /bin/busybox ] && shtype=a + cat< /bin/watchdog +#!/bin/${shtype}sh +echo \$$ > /tmp/watchdogpid +[ ! -f /proc/version ] && mount -n -t proc proc /proc +sleep 120 +echo "o" > /proc/sysrq-trigger +EOF + chmod u+x /bin/watchdog + watchdog & fi -} -errorhalt & # check if at least one type of IP configuration is availabe if [ -z "$DHCP" -a -z "$LDAP" -a -z "$IPINFO" ] ; then @@ -569,7 +571,10 @@ umount -n /sys || error "$init_errsys" nonfatal umount -n /proc/bus/usb >/dev/null 2>&1 mount -n --move /dev /mnt/dev chmod a+rwxt /mnt/dev/shm -killall -9 udevd sleep usleep 2>/dev/null +killall -9 udevd 2>/dev/null +# kill the watchdog (errhalt) +[ -f /tmp/watchdog ] && kill $(cat /tmp/watchdogpid) 2>/dev/null +# runtimer [ $DEBUGLEVEL -eq 8 ] && echo "** SLX init ended near $(sysup)" umount -n /proc # unset old environment variables -- cgit v1.2.3-55-g7522