Bug 62025 - halt script does not ensure complete cleanness of filesystems
halt script does not ensure complete cleanness of filesystems
Status: CLOSED WONTFIX
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.2
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-03-26 15:58 EST by Florin Andrei
Modified: 2014-03-16 22:26 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-03-26 15:58:50 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Florin Andrei 2002-03-26 15:58:45 EST
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@oss.sgi.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 01:40:00 EDT
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.