[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sheflug] fstab school project



Hi all Mary Christmas

Trying setting up user and group quota with linuxconf /local files systems
on /dev/hda7 /home

here is my original fstab file

/dev/hda1 / reiserfs notail 1 1
none /dev/pts devpts mode=0620 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda7 /home reiserfs notail 1 2
/dev/hdd /mnt/cdrom auto user,iocharset=iso8859-
1,umask=0,exec,codepage=850,ro,noauto 0 0
/dev/fd0 /mnt/floppy auto user,iocharset=iso8859-
1,umask=0,sync,exec,codepage=850,noauto 0 0
none /proc proc defaults 0 0
/dev/hda6 /var/www reiserfs notail 1 2
/dev/hda5 swap swap defaults 0 0

After use of linux conf it gave

/dev/hda1 / reiserfs notail 1 1
none /dev/pts devpts mode=0620 0 0
none /dev/shm tmpfs defaults 0 0
/dev/hda7	/home	reiserfs	 
exec,dev,suid,rw,usrquota,grpquota,notail 1 2
/dev/hdd /mnt/cdrom auto user,iocharset=iso8859-
1,umask=0,exec,codepage=850,ro,noauto 0 0
/dev/fd0 /mnt/floppy auto user,iocharset=iso8859-
1,umask=0,sync,exec,codepage=850,noauto 0 0
none /proc proc defaults 0 0
/dev/hda6 /var/www reiserfs notail 1 2
/dev/hda5 swap swap defaults 0 0

But failed to mount /dev/hda7 with quota support.

My script for addstudents is:

#! /bin/bash 

# /sbin/addteacher 
# 
# Create a new teacher account invoke like: 
#     addteacher [name] [password] 

PATH=/bin:/sbin:/usr/bin:/usr/sbin 

NAME=$1 
PASSWD=${2:-teacher} 

# Define error message 
usage () 
{ 
    echo " " 
    echo "Usage: addteacher [name] [password]" 
    echo "       If password is not specified" 
    echo "       it defaults to \"teacher\"" 
    echo " " 
} 

# Test for username 
if [ -z "$NAME" ]; then 
    usage 
    exit 1 
fi

# User exists? 
if id $NAME > /dev/null 2>&1; then 
    echo " " 
    echo "User exists!" 
    echo " " 
    exit 1 
fi

# Run the real useradd command 
if useradd -d /home/teachers/$NAME -g teachers -G students \ 
    -p `echo "print crypt('$PASSWD', 'RH');" | perl` \ 
    $NAME; then
    # Adding user to /etc/smbpasswd 
    echo "$PASSWD" > /etc/smbpwd 
    echo "$PASSWD" >> /etc/smbpwd 
    smbpasswd -s -a $NAME < /etc/smbpwd 
    rm -f /etc/smbpwd
    echo " " 
    echo "Success!" 
    echo "Added the user: $NAME" 
    echo "With password:  $PASSWD" 
    echo " " 
    # Set permissons for the home directory 
    chmod -R 2770 /home/teachers/$NAME 
    chown -R `id -u $NAME`.admin /home/teachers/$NAME 
    # Set quotas
    edquota -p quotateacher $NAME
else 
   echo " " 
   echo "Oops, something went wrong!" 
   echo " " 
fi

This workes after linuxconf has been used, but fails on reboot mounted volume 

/dev/hda7 /home

I have placed two file in home directory aquota.user aquota.group

Any ideas on this would be of great help

regards

fred

fred.dodd@btinternet.com
---------------------------------------------------
This e-mail and any files transmitted with it are
confidential and intended solely for the use of the
individual or entity to whom they are addressed. If
you have received this email in error please notify
the sender immediately.

Any views or opinions expressed in this e-mail are 
those of the sender and do not necessarily coincide
with those of North Trafford College.
___________________________________________________________________

Sheffield Linux User's Group - http://www.sheflug.co.uk . 
To unsubscribe from this list send mail to 
shef-lug-request@list.sheflug.org.uk with the word
"unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.