Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 7681

Summary: halt script fails to stop mdX devices
Product: [Retired] Red Hat Linux Reporter: Christian Hechelmann <drdisk>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 6.1CC: rvokal
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 1999-12-08 16:29:35 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christian Hechelmann 1999-12-08 14:50:50 UTC
The /etc/rc.d/init.d/halt fails to stop any md? devices, because of
unmounting /proc too early.

Furthermore only ext2 partitions are remounted ro during the last phase
of the shutdown, leaving any other filesystems mounted rw.

Patch follows:

--- /etc/rc.d/init.d/halt	Wed Dec  8 15:49:54 1999
+++ /etc/rc.d/init.d/halt.raid	Wed Dec  8 15:50:39 1999
@@ -83,7 +83,7 @@
 	retry=$(($retry-1))
 	sig=-9
 done
-runcmd "Unmounting proc file system" umount /proc
+
 mount -n -o remount,ro /

 # turn off raid
@@ -101,9 +101,11 @@
     #runcmd "Turning off RAID" /sbin/raidstop -a
 fi

+runcmd "Unmounting proc file system" umount /proc
+
 # Remount read only anything that's left mounted.
 #echo "Remounting remaining filesystems (if any) readonly"
-mount | awk '/ext2/ { print $3 }' | while read line; do
+mount -t noproc,devpts,nfs | awk '{ print $3 }' | while read line; do
     mount -n -o ro,remount $line
 done

Comment 1 Bill Nottingham 1999-12-08 16:29:59 UTC
Um, anthying else should already have been unmounted earlier.

The /proc unmounted has moved in CVS; will be fixed in
initscripts-4.72 when it is released.

Comment 2 Christian Hechelmann 1999-12-08 19:48:59 UTC
Sure, but if we are trying to remount the remaining fs' ro, we'd try this for
all the fs and not only ext2.

And if it happens, that a fs cannot be unmounted (in use), it might be possible
to remount it ro, so we can get around a (possibly lengthy) fsck run on
reboot...

Comment 3 Bill Nottingham 1999-12-13 16:13:59 UTC
*** Bug 7719 has been marked as a duplicate of this bug. ***