Bluehost.com Web Hosting $6.95

Re: [Samba] get quota command

This is a discussion on Re: [Samba] get quota command within the Samba forums, part of the Networking and Network Related category; I found the answer to my own question in a round about sort of way.. My NFS server is Solaris ...


Go Back   Usenet Forums > Networking and Network Related > Samba

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-22-2005
rick@oit.gatech.edu
 
Posts: n/a
Default Re: [Samba] get quota command


I found the answer to my own question in a round about sort of way..
My NFS server is Solaris w/UFS - thus no group quota support. It
seems when samba queries for user quotas and group quotas, it gets
unhappy when no group quota is returned, so the quotas are thrown
out and the windows boxes see the entire volume's free, used and
capacity. To fix this I set the two options in my conf file:
vfs objects = default_quota:quotasettings
quotasettings: gid = 65534

Rick Brown wrote:
> I've discovered that if I make a share from a local filesystem,
> the PC's mounting the share see their quota (hard limit, not
> soft which is another matter) as their capacity and their
> appropriate free space... this is good.


I found in the source that the hard limit is used instead of the
soft limit if the user is over quota.

> When I share ouf the NFS mounted volume, the PC's see the entire
> volume size and free space. Not so good. Okay fine, so I
> wrote a little cheesy script to run run quota and report back and
> defined it as "get quota command = myscript" in smb.conf.
> This works great... mostly. I wasn't seeing the values I
> expected to see, so I started dumping the arguments samba was
> passing to my scipt. I expected 3 fields: Path, type of query, and
> user/group ID. something like:
> "." 1 32849 (user quota)
> "." 3 1178 (group quota)
>
> instead, I'm seeing samba pass:
> "." 2 32849 (default user quota)
> "." 4 1178 (default group quota)
>
> Why is samba asking for the default user and group quotas instead of
> the actual user and group quotas? From the documentation I would
> have expected that if field 2 was a 2 or 4, then the uid/gid would be
> -1. How can I make samba request the actual user and group's quota
> instead of the defaults?


And since I didn't easily find any examples of a "get quota command"
I'll share my super-cheesy script which totally ignores the values
passed to it by samba. It's not pretty, but it works.

#!/bin/ksh
PATH=/usr/bin:/usr/sbin:/bin
IAM=`id -un`
# find the user's home file system.
DIR=`ypmatch $IAM passwd | awk -F: '{print $6}' | cut -f 2 -d "/"`
#check and see if they're over quota, as it will affect output
OVER=`quota -F rpc -v $IAM | grep $DIR | wc -w`
#OVER=`quota -f rpc -v $IAM | grep $DIR | egrep -i "expired|days"
#if [ $? -ne 0]; then

# over quota
if [ $OVER -gt 7 ]; then
RET=`quota -v $IAM | grep ${DIR} | awk -F" " '{print "2 "$2"
"$3" "$4" "$7" "$8" "$9}'`
else
# not over quota
RET=`quota -v $IAM | grep ${DIR} | awk -F" " '{print "2 "$2"
"$3" "$4" "$5" "$6" "$7}'`
fi
# linux "quota" puts a * after the used blocks if the user is over quota
STRIPPED=`echo $RET | sed 's/*/ /g'`
echo $STRIPPED


--
[ Rick Brown ][ (404) 894-6175 ]
[ Office of Information Technology ][ rick@oit.gatech.edu ]
[ Georgia Institute of Technology ][ 258 4th street. Atlanta, GA ]
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 06:59 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0