Editing Automatically setting quotaugidlimit
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 | + | 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 | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
# 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 [ | + | if [ $INT != 0 ]; |
then | then | ||
# get configfile name | # get configfile name | ||
Line 49: | Line 40: | ||
TOTAL=$(($USERC + $GROUPC + 15)) | TOTAL=$(($USERC + $GROUPC + 15)) | ||
− | + | # set the new quotaugidlimit for container | |
− | + | vzctl set $VEID --quotaugidlimit $TOTAL --save | |
− | |||
− | |||
− | |||
− | |||
− | |||
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. | ||
− | |||
− |