diff options
author | Preston Brown <pbrown@redhat.com> | 2001-09-05 18:48:40 +0000 |
---|---|---|
committer | Preston Brown <pbrown@redhat.com> | 2001-09-05 18:48:40 +0000 |
commit | bad512c4cd07ef5945f8c833968cb7092fb42336 (patch) | |
tree | e58467862359ff6323f2a881d2ea8bee5f232302 | |
parent | 1232e44021ec9cee1bede0107a85e3081443b7c6 (diff) | |
download | initscripts-bad512c4cd07ef5945f8c833968cb7092fb42336.tar initscripts-bad512c4cd07ef5945f8c833968cb7092fb42336.tar.gz initscripts-bad512c4cd07ef5945f8c833968cb7092fb42336.tar.bz2 initscripts-bad512c4cd07ef5945f8c833968cb7092fb42336.tar.xz initscripts-bad512c4cd07ef5945f8c833968cb7092fb42336.zip |
backport quota updates.
-rwxr-xr-x | rc.d/init.d/halt | 2 | ||||
-rwxr-xr-x | rc.d/rc.sysinit | 71 |
2 files changed, 41 insertions, 32 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt index 566b8a60..501ed0d3 100755 --- a/rc.d/init.d/halt +++ b/rc.d/init.d/halt @@ -118,7 +118,7 @@ SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps` [ -x /sbin/accton ] && runcmd $"Turning off accounting: " /sbin/accton -[ -x /sbin/quotaoff ] && runcmd $"Turning off quotas: " /sbin/quotaoff -a +[ -x /sbin/quotaoff ] && runcmd $"Turning off quotas: " /sbin/quotaoff -aug # Unmount file systems, killing processes if we have to. # Unmount loopback stuff first diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 0261dd0d..2df69bcd 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -248,6 +248,26 @@ if [ -z "$fastboot" -a "$ROOTFSTYPE" != "nfs" ]; then fi fi +grep -E '[[:space:]]+/[[:space:]]+' /etc/fstab | \ + awk '{ print $4 }' | \ + grep -q quota +_ROOT_HAS_QUOTA=$? +if [ X"$_RUN_QUOTACHECK" = X1 -a \ + "$_ROOT_HAS_QUOTA" -a \ + -x /sbin/quotacheck ]; then + if [ -x /sbin/convertquota ]; then + if [ -f /quota.user ]; then + action $"Converting old user quota files: " \ + /sbin/convertquota -u / && rm -f /quota.user + fi + if [ -f /quota.group ]; then + action $"Converting old group quota files: " \ + /sbin/convertquota -g / && rm -f /quota.group + fi + fi + action $"Checking root filesystem quotas: " /sbin/quotacheck -n / +fi + # check for arguments if grep -iq nopnp /proc/cmdline >/dev/null 2>&1 ; then @@ -333,19 +353,6 @@ if [ -x /sbin/hdparm ]; then done fi -# Update quotas if fsck was run on /. -if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then - if [ -x /sbin/convertquota ]; then - if [ -f /quota.user ]; then - /sbin/convertquota -u / && rm -f /quota.user - fi - if [ -f /quota.group ]; then - /sbin/convertquota -g / && rm -f /quota.group - fi - fi - action $"Checking root filesystem quotas: " /sbin/quotacheck -v / -fi - # The root filesystem is now read-write, so we can now log via syslog() directly.. if [ -n "$IN_INITLOG" ]; then IN_INITLOG= @@ -526,20 +533,26 @@ fi action $"Mounting local filesystems: " mount -a -t nonfs,smbfs,ncpfs if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then - if [ -x /sbin/convertquota ]; then - # try to convert old quotas - for mountpt in `cat /etc/mtab | awk '$4 ~ /quota/{print $2}'`; do - if [ -f "$mountpt/quota.user" ]; then - /sbin/convertquota -u $mountpt && \ - rm -f $mountpt/quota.user - fi - if [ -f "$mountpt/quota.group" ]; then - /sbin/convertquota -g $mountpt && \ - rm -f $mountpt/quota.group - fi - done - fi - action $"Checking filesystem quotas: " /sbin/quotacheck -v -R -a + if [ -x /sbin/convertquota ]; then + # try to convert old quotas + for mountpt in `cat /etc/mtab | awk '$4 ~ /quota/{print $2}'`; do + if [ -f "$mountpt/quota.user" ]; then + action $"Converting old user quota files: " \ + /sbin/convertquota -u $mountpt && \ + rm -f $mountpt/quota.user + fi + if [ -f "$mountpt/quota.group" ]; then + action $"Converting old group quota files: " \ + /sbin/convertquota -g $mountpt && \ + rm -f $mountpt/quota.group + fi + done + fi + action $"Checking local filesystem quotas: " /sbin/quotacheck -aR +fi + +if [ -x /sbin/quotaon ]; then + action $"Enabling local filesystem quotas: " /sbin/quotaon -aug fi # Turn on process accounting @@ -576,10 +589,6 @@ if [ -f /.unconfigured ]; then rm -f /.unconfigured fi -if [ -x /sbin/quotaon ]; then - action $"Turning on user and group quotas for local filesystems: " /sbin/quotaon -a -fi - # Clean out /etc. rm -f /fastboot /fsckoptions /forcefsck /halt /poweroff |