--- marlow.us.tuxbox.nu/etc/rc.d/init.d/halt.orig 2005-01-27 21:55:13.000000000 +0000 +++ marlow.us.tuxbox.nu/etc/rc.d/init.d/halt 2005-01-27 21:57:15.000000000 +0000 @@ -54,17 +54,6 @@ ;; esac -# Recreate the /initrd if needed -if [ ! -d /initrd ]; then - runcmd "Creating initrd directory" mkdir /initrd -fi -if [ -d /initrd -a ! -f /initrd/README.WARNING ]; then - cat > /initrd/README.WARNING < /etc/mtab) - -# Unmount file systems, killing processes if we have to. -# Unmount loopback stuff first -remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` -devremaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts` -[ -n "$remaining" ] && { - sig= - retry=3 - while [ -n "$remaining" -a "$retry" -gt 0 ] - do - if [ "$retry" -lt 3 ]; then - runcmd "Unmounting loopback filesystems (retry):" umount $remaining - else - runcmd "Unmounting loopback filesystems: " umount $remaining - fi - for dev in $devremaining ; do - losetup $dev > /dev/null 2>&1 && \ - runcmd "Detaching loopback device %s: " $dev losetup -d $dev - done - remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts` - devremaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts` - [ -z "$remaining" ] && break - /sbin/fuser -k -m $sig $remaining >/dev/null - sleep 5 - retry=$(($retry -1)) - sig=-9 - done -} - -sig= -retry=3 -remaining=`halt_get_remaining | sort -r` - -while [ -n "$remaining" -a "$retry" -gt 0 ] -do - if [ "$retry" -lt 3 ]; then - LC_ALL=C runcmd "Unmounting file systems (retry): " umount -f $remaining - else - LC_ALL=C runcmd "Unmounting file systems: " umount -f $remaining - fi - sleep 2 - remaining=`halt_get_remaining | sort -r` - [ -z "$remaining" ] && break - /sbin/fuser -k -m $sig $remaining >/dev/null - sleep 5 - retry=$(($retry-1)) - sig=-9 -done - -if [ -d /proc/lvm -a -x /sbin/vgchange -a -f /etc/lvmtab ]; then - runcmd "Shutting down LVM:" /sbin/vgchange -a n -fi - -[ -f /proc/bus/usb/devices ] && umount /proc/bus/usb - # remove the crash indicator flag rm -f /.autofsck -# Try them all, one last time. -umount -a -f -t nodevfs,noproc - -# Remount read only anything that's left mounted. -#gprintf "Remounting remaining filesystems (if any) readonly\n" -mount | awk '/( \/ |^\/dev\/root)/ { print $3 }' | while read line; do - mount -n -o ro,remount $line -done - -runcmd "Unmounting proc file system: " umount /proc - - -# See if this is a powerfail situation. -if [ -f /etc/apcupsd/powerfail ]; then - gprintf "APCUPSD will now power off the UPS!\n" - echo - /etc/apcupsd/apccontrol killpower - echo - gprintf "Please ensure that the UPS has powered off before rebooting\n" - gprintf "Otherwise, the UPS may cut the power during the reboot!!!\n" - echo - sleep 120 - exit 1 -elif [ -f /etc/killpower -a -f /etc/init.d/upsd ]; then - gprintf "NUT will now power off the UPS!\n" - echo - /etc/init.d/upsd powerdown - echo - gprintf "Please ensure that the UPS has powered off before rebooting\n" - gprintf "Otherwise, the UPS may cut the power during the reboot!!!\n" - echo - sleep 120 - exit 1 -fi - -# Now halt or reboot. -echo "$message" -if [ -f /fastboot ]; then - gprintf "On the next boot fsck will be skipped.\n" -elif [ -f /forcefsck ]; then - gprintf "On the next boot fsck will be forced.\n" -fi - -if [ "$command" = /sbin/halt -a -r /etc/ups/upsmon.conf -a -f /etc/killpower -a -f /etc/sysconfig/ups ] ; then - . /etc/sysconfig/ups - [ "$SERVER" = "yes" -a "$MODEL" != "NONE" -a -n "$MODEL" -a -n "$DEVICE" ] && $MODEL $OPTIONS_HALT -k $DEVICE -fi - if [ -x /sbin/halt.local ]; then /sbin/halt.local fi -HALTARGS="-i -d -p" - -exec $command $HALTARGS +exec $command --- marlow.us.tuxbox.nu/etc/rc.d/rc.orig 2005-01-27 22:47:48.000000000 +0000 +++ marlow.us.tuxbox.nu/etc/rc.d/rc 2005-01-27 22:48:19.000000000 +0000 @@ -64,9 +64,6 @@ else gprintf "Entering non-interactive startup\n" fi -elif [[ "$newrunlevel" = "0" || "$newrunlevel" = "6" ]]; then - chvt 1 - exec &> /dev/console fi # Tell linuxconf what runlevel we are in