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
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?
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.
*** 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.
Fixed in initscripts 3.83.