diff options
Diffstat (limited to 'rc.d/rc.sysinit')
-rwxr-xr-x | rc.d/rc.sysinit | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 64cb7911..4cd75e86 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -254,7 +254,28 @@ if [ -z "$fastboot" -a "$ROOTFSTYPE" != "nfs" ]; then fi fi -# check for arguments +# Possibly update quotas if fsck was run on /. +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 passed from kernel if grep -iq nopnp /proc/cmdline >/dev/null 2>&1 ; then PNP= @@ -278,7 +299,7 @@ state=`awk '/(^\/dev\/root| \/ )/ { print $4 }' /proc/mounts` # LVM initialization if [ -e /proc/lvm -a -x /sbin/vgchange -a -f /etc/lvmtab ]; then - action $"Setting up LVM:" /sbin/vgscan && /sbin/vgchange -a y + action $"Setting up Logical Volume Management:" /sbin/vgscan && /sbin/vgchange -a y fi # Clear mtab @@ -339,18 +360,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 @@ -533,21 +542,28 @@ fi # filesystems are NOT unmounted in single user mode. action $"Mounting local filesystems: " mount -a -t nonfs,smbfs,ncpfs -O nonetdev +# check remaining quotas other than root 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 + 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 filesystem quotas: " /sbin/quotacheck -v -R -a + action $"Checking local filesystem quotas: " /sbin/quotacheck -aR +fi + +if [ -x /sbin/quotaon ]; then + action $"Enabling local filesystem quotas: " /sbin/quotaon -a fi # Turn on process accounting @@ -584,10 +600,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 |