Editing Automatically setting quotaugidlimit

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
If you are using second-level user/group quota with simfs for your containers, you have to take care that the value at every moment is high enough. Otherwise, newly created users and groups within the CT won't be able to own files. '''Note this is not required for ploop layout, in which quotaugidlimit is enabled with any non-zero value.'''
+
If you are using second-level user/group quota for your containers, you have to take care that the value at every moment is high enough. Otherwise, newly created users and groups within the VE won't be able to own files.
  
 
Rather than checking these values from time to time by hand, you can use the shell script from below to automatically set the quotaugidlimit based on the needs of the individual containers. Just setup a cronjob for it.
 
Rather than checking these values from time to time by hand, you can use the shell script from below to automatically set the quotaugidlimit based on the needs of the individual containers. Just setup a cronjob for it.
Line 17: Line 17:
 
for file in $FILES
 
for file in $FILES
 
do
 
do
STRING=""
 
VALUE=""
 
INT=""
 
CONFFILE=""
 
VEID=""
 
USERC=""
 
GROUPC=""
 
TOTAL=""
 
 
 
# source the config file
 
# source the config file
 
. $file
 
. $file
Line 38: Line 29:
  
 
# check if quotaugidlimit is > 0
 
# check if quotaugidlimit is > 0
if [ ! $INT == 0 ];
+
if [ $INT != 0 ];
 
then
 
then
 
# get configfile name
 
# get configfile name
Line 49: Line 40:
 
TOTAL=$(($USERC + $GROUPC + 15))
 
TOTAL=$(($USERC + $GROUPC + 15))
  
# only change if current value is lower
+
# set the new quotaugidlimit for container
if [ $TOTAL -gt $INT ];
+
vzctl set $VEID --quotaugidlimit $TOTAL --save
then
 
# set the new quotaugidlimit for container
 
vzctl set $VEID --quotaugidlimit $TOTAL --save
 
echo "New quotaugidlimit set to $TOTAL for VEID $VEID\n"
 
fi
 
 
fi
 
fi
 
fi
 
fi
Line 62: Line 48:
  
 
This will check for current users/groups count and increate the value by 15 - and set it as a new limit for the container.
 
This will check for current users/groups count and increate the value by 15 - and set it as a new limit for the container.
 
[[Category:HOWTO]]
 

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)