Bug 62025 - halt script does not ensure complete cleanness of filesystems
Summary: halt script does not ensure complete cleanness of filesystems
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.2
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-03-26 20:58 UTC by Florin Andrei
Modified: 2014-03-17 02:26 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2002-03-26 20:58:50 UTC
Embargoed:


Attachments (Terms of Use)

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.


Note You need to log in before you can comment on or make changes to this bug.