From 0abc24ab8a6692ea7f2ab7bcf9cf088d685ede8d Mon Sep 17 00:00:00 2001 From: Preston Brown Date: Sat, 10 Mar 2001 22:50:53 +0000 Subject: work properly with new quota utilities; convert old quota format if possible. --- rc.d/rc.sysinit | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'rc.d/rc.sysinit') diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 8b27bcdc..ced6d325 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -331,6 +331,14 @@ 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 @@ -512,6 +520,18 @@ 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 action $"Checking filesystem quotas: " /sbin/quotacheck -v -R -a fi -- cgit v1.2.1