Bug 703 - /etc/rc.d/rc.sysinit tries to run quotacheck on read-only filesystems
/etc/rc.d/rc.sysinit tries to run quotacheck on read-only filesystems
Status: CLOSED CURRENTRELEASE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
5.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
: 929 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-01-06 09:14 EST by zblaxell
Modified: 2014-03-16 22:08 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-01-25 09:22:20 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 zblaxell 1999-01-06 09:14:35 EST
This patch makes quotacheck work properly.  In the shipped
5.2 CD, rc.sysinit will attempt to run quotacheck before
mounting filesystems read-write.  This attempt will fail:
writing to quota.user on the filesystem returns "read only
file system".

This patch moves the quotacheck to after the filesystems are
remounted.

The patch also removes the now redundant
'/etc/rc.d/init.d/random start' at the end of rc.sysinit;
this is now handled by its own /etc/rc.d/rc?.d/S??* script.

root@naga:~# diff -u /etc/rc.d/rc.sysinit{.rpmorig,}
--- /etc/rc.d/rc.sysinit.rpmorig        Wed Jan  6 08:57:53
1999
+++ /etc/rc.d/rc.sysinit        Wed Jan  6 09:02:38 1999
@@ -60,9 +60,6 @@
                mount -n -o remount,ro /
                echo "Automatic reboot in progress."
                reboot
-       elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
-               echo "Checking root filesystem quotas"
-               /sbin/quotacheck -v /
        fi
 fi

@@ -94,6 +91,12 @@
 echo "Remounting root filesystem in read-write mode."
 mount -n -o remount,rw /

+# Check quotas if fsck fixed something.
+if [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
+       echo "Checking root filesystem quotas"
+       /sbin/quotacheck -v /
+fi
+
 if [ ! -f /etc/HOSTNAME ]; then
     echo ${HOSTNAME} > /etc/HOSTNAME
 fi
@@ -211,9 +214,6 @@
                mount -n -o remount,ro /
                echo "Automatic reboot in progress."
                reboot
-       elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
-               echo "Checking filesystem quotas"
-               /sbin/quotacheck -v -R -a
        fi
 fi

@@ -223,6 +223,12 @@
 echo "Mounting local filesystems."
 mount -a -t nonfs,proc

+# Check quotas if fsck fixed something.
+if [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
+       echo "Checking filesystem quotas"
+       /sbin/quotacheck -v -R -a
+fi
+
 # set the console font
 if [ -x /sbin/setsysfont ]; then
     /sbin/setsysfont
@@ -327,6 +333,3 @@
 # Now that we have all of our basic modules loaded and the
kernel going,
 # let's dump the syslog ring somewhere so we can find it
later
 dmesg > /var/log/dmesg
-
-# Feed entropy into the entropy pool
-/etc/rc.d/init.d/random start
Comment 1 Jeff Johnson 1999-01-06 14:01:59 EST
The quota change looks like the right thing to do. However, why
did you delete the
	/etc/rc.d/init.d/random start
line at the end of your patch?
Comment 2 zblaxell 1999-01-07 10:04:59 EST
The '/etc/rc.d/init.d/random start' at the end of /etc/rc.d/rc.sysinit
is redundant.  There is a /etc/rc.d/rc3.d/S??random symlink which sets
up the random device, so the same thing in rc.sysinit means that the
random device is initialized twice and can't be turned off if desired
with the setup program.

It doesn't have anything to do with quotas, it's just cleaning up.  I
probably should have submitted two separate bug reports.
Comment 3 Jeff Johnson 1999-01-24 14:17:59 EST
*** Bug 929 has been marked as a duplicate of this bug. ***

During system boot, rc.sysinit calls /sbin/quotaon BEFORE
the root partition has been remounted read-write.  This
causes quotas to never be enabled, until the partition
gets fsck'ed one day -- at which point, it is mounted RW
by the time quotaon gets called.

Simply moving lines 69-72 below line 96 (initscripts-3.78-1)
would resolve the issue, I think.
Comment 4 Jeff Johnson 1999-01-25 09:22:59 EST
Fixed in initscripts 3.83.

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