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

Bug 62025

Summary: halt script does not ensure complete cleanness of filesystems
Product: [Retired] Red Hat Linux Reporter: Florin Andrei <florin>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED WONTFIX QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: 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: 2002-03-26 20:58:50 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 Florin Andrei 2002-03-26 20:58:45 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/20020205

Description of problem:
/etc/init.d/halt unmounts and re-mounts read-only the filesystems without making
absolutely sure the disk caches are flushed before.
In an ideal world, this shouldn't be a bad thing, because remount ro is supposed
to do that, but sometimes, due to weird bugs in different filesystems and/or
utilities, it doesn't.
It is therefore far more safe to perform a /bin/sync after killing all processes
but before remounting filesystems. Some other distributions do that (i think
Slackware is an example), and i think they have a good reason for it.

Version-Release number of selected component (if applicable):


How reproducible:
Sometimes

Steps to Reproduce:
1. Install Red Hat 7.2 SGI version (using XFS as a filesystem)
2. Use ntsysv to manage services
3. Reboot
	

Actual Results:  The system should come up cleanly

Expected Results:  A lot of files in /etc/xinetd.d get corrupted.

Additional info:

This problem has been discussed on linux-xfs.com The thread is here:
http://oss.sgi.com/projects/xfs/mail_archive/0203/msg00331.html
Quite a few sysadmins made a point from performing a "sync" before
rebooting/halting a system, as a good precaucion; i think the OS should learn
from their experience. ;-)
Please don't dismiss this bug report as being "XFS related" or anything like
that. I believe sync-ing the filesystems before remounting them increases the
reliability of the OS; Red Hat should do that (some other distributions already
do that).

Here is my patch for /etc/init.d/halt:

[root@stantz root]# diff -u halt.orig halt
--- halt.orig	Tue Mar 26 12:32:46 2002
+++ halt	Tue Mar 26 12:49:15 2002
@@ -125,6 +125,10 @@
 
 [ -x /sbin/quotaoff ] && runcmd $"Turning off quotas: " /sbin/quotaoff -aug
 
+# Sync all filesystems, just in case
+[ -x /bin/sync ] && runcmd $"Syncing all filesystems: " /bin/sync
+sleep 5
+
 # Unmount file systems, killing processes if we have to.
 # Unmount loopback stuff first
 remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts`
[root@stantz root]#

Maybe the sleep parameter should be tuned in /etc/sysconfig/... ? I'm not sure
which is the best value for it.

Comment 1 Bill Nottingham 2002-04-10 05:40:00 UTC
You mention "but sometimes, due to weird bugs in different filesystems and/or
utilities, it doesn't." - then those bugs should be fixed.