X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=etc%2Finit.d%2Fgrml-reboot;h=ebc91730cbafe4679117656a449e956c28dd55a5;hb=699350f077f1bf4eb7e47ae940e0503129ad81b5;hp=990736b36cb664ec9abedc8998036cdfa6ac98c7;hpb=8e4df055dff77714bac33b6705678c14f5352fca;p=grml-etc.git diff --git a/etc/init.d/grml-reboot b/etc/init.d/grml-reboot index 990736b..ebc9173 100755 --- a/etc/init.d/grml-reboot +++ b/etc/init.d/grml-reboot @@ -4,7 +4,7 @@ # Authors: grml-team (grml.org), (c) Klaus Knopper, (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Sam Mär 31 14:02:06 CEST 2007 [mika] +# Latest change: Die Jun 26 00:08:30 CEST 2007 [mika] ################################################################################ export PATH=/sbin:/bin:/usr/bin:/usr/sbin @@ -55,13 +55,15 @@ echo "0" > /proc/sys/kernel/printk # We may kill our network connection here before unmounting NFS. Bad luck. # poweroff pcmcia devices if [ -d /sys/bus/pcmcia -a -x /sbin/pccardctl ] ; then + # make sure we don't lose any data, see issue219 for details + log_begin_msg "Syncing devices..." + sync ; log_end_msg $? log_begin_msg "Shutting down PCMCIA devices..." pccardctl eject >/dev/null 2>&1 log_end_msg $? fi if [ -n "$INSTALLED" ] ; then - echo log_begin_msg_nn "Running /etc/init.d/rc ${level}: " /etc/init.d/rc $level 1>/dev/null 2>&1 & mysleep "$GREEN" @@ -98,7 +100,7 @@ else NETMOUNTS="$(awk '{if($1~/:/){print $2}}' /proc/mounts 2>/dev/null)" if [ -n "$NETMOUNTS" ]; then log_begin_msg "Unmounting network filesystems." - umount -t nfs -arvf 2>/dev/null ; log_end_msg $? + umount -t nfs,nfs4,smbfs -alvf 2>/dev/null fi # Shutdown network NETDEVICES="$(/sbin/ifconfig | awk '/^[^ ]+/ {print $1}' | grep -v '^lo$')" @@ -144,12 +146,12 @@ if [ -z "$NOEJECT" ]; then for dev in /proc/sys/dev/cdrom*/autoeject; do [ -f "$dev" ] && echo 1 > "$dev"; done fi -# Turn on auto-eject feature of cdrom (2.2 kernel) +# Detected cdrom device if [ -z "$INSTALLED" ]; then CDROM="$(awk '/ \/cdrom /{print $1;exit 0;}' /proc/mounts)" fi -# Now umount everything but root +# Umount everything but root log_begin_msg "Unmounting file systems." # Be safe in case someone messed with /etc/mtab @@ -162,7 +164,9 @@ fi for i in /dev/loop*; do losetup -d $i 2>/dev/null; done # Remove remaining unused modules (Kernel 2.4) -rmmod -a >/dev/null 2>&1 +# rmmod -a >/dev/null 2>&1 + +umount -t notmpfs,nosysfs,noproc,nousbfs -adrvf 1>/dev/null 2>&1 log_end_msg 0 @@ -176,9 +180,8 @@ if [ -z "$INSTALLED" -a -z "$NOPROMPT" ]; then else umount -l /cdrom [ -n "$CDROM" -a -z "$NOEJECT" ] && eject -p "$CDROM" 2>/dev/null - echo "" - echo "${GREEN}Please remove CD, close cdrom drive and hit return.${NORMAL}" - read + echo + read -s -p "${GREEN}Please remove CD, close cdrom drive and hit return [auto 2 minutes].${NORMAL}" -t 120 a fi fi