Bug 703 - /etc/rc.d/rc.sysinit tries to run quotacheck on read-only filesystems
Summary: /etc/rc.d/rc.sysinit tries to run quotacheck on read-only filesystems
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 5.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
: 929 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-01-06 14:14 UTC by zblaxell
Modified: 2014-03-17 02:08 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-01-25 14:22:20 UTC


Attachments (Terms of Use)

Description zblaxell 1999-01-06 14:14:35 UTC
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 19:01:59 UTC
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 15:04:59 UTC
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 19:17:59 UTC
*** 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 14:22:59 UTC
Fixed in initscripts 3.83.


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