Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 39426 - quota started too late during boot
Summary: quota started too late during boot
Status: VERIFIED FIXED
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Gentoo Security Guide (show other bugs)
Hardware: All Linux
: High major (vote)
Assignee: Sven Vermeulen (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-26 00:15 UTC by Kent B. Hansen
Modified: 2005-07-29 06:00 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kent B. Hansen 2004-01-26 00:15:31 UTC
Quota is started AFTER several deamons is already running (postfix, mysql etc.) - and these open/locks files on the filesystem, preventing quotacheck in the initscript to run.

Reproducible: Always
Steps to Reproduce:
1. Install quota and some deamon, for instance postfix.
2. Set quota on the partition, on which postfix is locking files (for instance /var).
3. Initialize the quota-file: "rm -f /var/aquota.user; touch /var/aquota.user; chmod 600 /var/aquota.user".
4. Reboot.

Actual Results:  
Quotacheck fails during boot. Quote:
"quotacheck: Cannot remount filesystem mounted on /var read-only so counted 
values might not be right.
Please stop all programs writing to filesystem or use -m flag to force 
checking."


Expected Results:  
Quota should be turned on BEFORE other software begin to use files on the 
partitions. This way, it can initialize the aquota.user file correctly.

Adding a "before *" to the init-script /etc/init.d/quota from:

depend() {
        need localmount
}

to:

depend() {
        need localmount
        before *
}

seems to do the trick - at least for me. Could you please include this change 
in the package?

I've marked this bug "Major", since it prevents me for using quota on several 
partitions.
Comment 1 Kent B. Hansen 2004-01-26 06:11:08 UTC
The change mentioned above results in a warning when updating packages ("emerge -uD world"), see the last two *s below:

  * Caching service dependencies...
 *  Services 'quota' and 'checkroot' have circular
 *  dependency of type 'ibefore';  continuing...                                                    [ ok ]

I don't know if this is a problem, and if so, how to work around it...
Comment 2 Kent B. Hansen 2004-01-29 11:24:39 UTC
Adding quota to the boot runlevel, instead of the default runlevel, seems to do wonders (without altering the init-script).

So, use: "rc-update add quota boot"

And NOT "rc-update add quota default" as stated in the "Gentoo Linux Security Guide" (Code listing 6.5).
Comment 3 Sven Vermeulen (RETIRED) gentoo-dev 2004-02-07 04:03:06 UTC
Thanks. I've updated the security guide in CVS.
Comment 4 Kent B. Hansen 2005-07-29 06:00:23 UTC
Bug closed