Skip to content

Commit b4b7316

Browse files
authored
Merge pull request #269 from NikolayVoina/Update-information-about-limits
Update information about limits
2 parents cc80aed + 4e71fca commit b4b7316

File tree

2 files changed

+112
-2
lines changed

2 files changed

+112
-2
lines changed

docs/cloudlinuxos/command-line_tools/README.md

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3405,10 +3405,15 @@ cloudlinux-config set --json --data '{"options":{"uiSettings":{"hideRubyApp":fal
34053405
### cl-quota
34063406
34073407
* [General provisions](./#general-provisions)
3408+
* [Known cl-quota limitations behaviour](./#known-cl-quota-limitations-behaviour)
3409+
* [cPanel User File Synchronization](./#cpanel-user-file-synchronization)
3410+
* [What is Synchronized](./#what-is-synchronized)
3411+
* [What is NOT Synchronized](./#what-is-not-synchronized)
34083412
* [Setting limits and integration with panel packages](./#setting-limits-and-integration-with-panel-packages)
34093413
* [Limits inheritance](./#limits-inheritance)
34103414
* [Caching and synchronizing the limits](./#caching-and-synchronizing-the-limits)
34113415
* [Quotas DB file](./#quotas-db-file)
3416+
* [Troubleshooting](./#troubleshooting)
34123417
* [CLI options/examples](./#cli-options-examples)
34133418
34143419
<span class="notranslate">**cl-quota**</span> utility is designed to control <span class="notranslate">disk quotas</span> and provides:
@@ -3456,6 +3461,50 @@ cat /var/log/messages | grep clquota
34563461
You should not set soft limit higher than hard limit. cl-quota does not control it in any way, but in some cases, the system can ban such limits combination and they won’t be set or will be set in some other way.
34573462
:::
34583463
3464+
#### Known cl-quota limitations behaviour
3465+
3466+
::: tip Key Points Administrators Should Know:
3467+
3468+
* **User Creation**: All users (including panel users) are created with limits equal to 0
3469+
* **Synchronization Timing**: Limits are applied within 5 minutes of user creation via automatic cron job
3470+
* **File Discrepancies**: cPanel user files may show different values than actual enforced limits
3471+
* **Cache Mechanism**: Non-root users see cached data from `/etc/container/cl-quotas.cache`
3472+
* **Package Inheritance**: Users inherit package limits unless individual limits are set
3473+
* **Special Values**:
3474+
- `0` means inherit from package or uid=0
3475+
- `-1` means unlimited (displayed as dash `-`)
3476+
- Words "default" and "unlimited" are interchangeable with 0 and -1
3477+
* **Auto-Sync Control**: Can be disabled via `cl_quota_limits_autosync=no` in `/etc/sysconfig/cloudlinux`
3478+
* **Root User**: Limits are never set for root (uid=0) but stored for inheritance
3479+
* **Validation**: cl-quota doesn't validate soft/hard limit relationships
3480+
:::
3481+
3482+
#### cPanel User File Synchronization
3483+
3484+
* <span class="notranslate">cl-quota</span> does **NOT** synchronize inode limits with cPanel user configuration files (<span class="notranslate">`/var/cpanel/users/*`</span>)
3485+
* Changes made through LVE Manager to package inode limits are correctly applied at the system quota level but do **not** update the corresponding user files
3486+
* This can result in discrepancies where:
3487+
- <span class="notranslate">`/var/cpanel/packages/packagename`</span> shows updated limits
3488+
- <span class="notranslate">`/var/cpanel/users/username`</span> shows old limit values
3489+
- System quota (<span class="notranslate">`repquota`</span>) and API show correct current limits
3490+
- Actual quota enforcement works correctly despite the file discrepancy
3491+
3492+
#### What is Synchronized
3493+
3494+
<span class="notranslate">cl-quota</span> synchronizes the following:
3495+
* Internal quota database file (<span class="notranslate">`/etc/container/cl-quotas.dat`</span>)
3496+
* cPanel package files
3497+
* System-level quota limits
3498+
3499+
#### What is NOT Synchronized
3500+
3501+
<span class="notranslate">cl-quota</span> does **NOT** synchronize:
3502+
* cPanel user configuration files (<span class="notranslate">`/var/cpanel/users/*`</span>)
3503+
3504+
::: tip Note
3505+
The lack of user file synchronization does not affect the actual quota enforcement. Inode limits are applied at the system quota level and function correctly regardless of what is stored in cPanel user files. The discrepancy is cosmetic and affects only file-based configuration visibility.
3506+
:::
3507+
34593508
#### Setting limits and integration with panel packages
34603509
34613510
@@ -3574,6 +3623,63 @@ It follows that:
35743623
35753624
* The users of <span class="notranslate"> pack1 </span> package will get <span class="notranslate"> pack1 </span> limits (5000:-1), the users of all the rest of the packages will get the limits of uid=0 because no limits are set for them. Exceptions: uid=500 and 958. uid=500 has both limits set individually, and uid=958 inherits only <span class="notranslate"> soft </span> limits.
35763625
3626+
#### Troubleshooting
3627+
3628+
**Inode Limits Synchronization Issues**
3629+
3630+
If you notice discrepancies between different sources showing inode limits, this is likely due to the [known limitations](#known-cl-quota-limitations-behaviour) of <span class="notranslate">cl-quota</span>. Here's how to troubleshoot:
3631+
3632+
**How to check actual limits**
3633+
3634+
To check what limits are actually enforced, please use these commands:
3635+
3636+
<div class="notranslate">
3637+
3638+
```bash
3639+
# Check system quota (this is what's actually enforced)
3640+
repquota -u /
3641+
3642+
# Check specific user quota
3643+
quota -u username
3644+
3645+
# Check what cl-quota thinks the limits are
3646+
cl-quota
3647+
3648+
# Check package limits
3649+
cl-quota --package-limits
3650+
```
3651+
</div>
3652+
3653+
**Script to verify user package and actual limits via CLI**
3654+
3655+
<div class="notranslate">
3656+
3657+
```bash
3658+
# Script to show user, package, and actual quota comparison
3659+
for userfile in /var/cpanel/users/*; do
3660+
user=$(basename "$userfile")
3661+
plan=$(grep '^PLAN=' "$userfile" | cut -d= -f2)
3662+
3663+
# Get package limits
3664+
pkg_soft=$(grep '^lve_inodes_soft=' "/var/cpanel/packages/$plan" 2>/dev/null | cut -d= -f2)
3665+
pkg_hard=$(grep '^lve_inodes_hard=' "/var/cpanel/packages/$plan" 2>/dev/null | cut -d= -f2)
3666+
3667+
# Get user file limits
3668+
user_soft=$(grep '^lve_inodes_soft=' "$userfile" 2>/dev/null | cut -d= -f2)
3669+
user_hard=$(grep '^lve_inodes_hard=' "$userfile" 2>/dev/null | cut -d= -f2)
3670+
3671+
# Get actual system quota
3672+
actual_quota=$(repquota -u / | grep "^$user " | awk '{print $6 ":" $7}')
3673+
3674+
echo "User: $user, Package: $plan"
3675+
echo " Package limits: ${pkg_soft:-N/A}:${pkg_hard:-N/A}"
3676+
echo " User file limits: ${user_soft:-N/A}:${user_hard:-N/A}"
3677+
echo " Actual quota: ${actual_quota:-N/A}"
3678+
echo "---"
3679+
done
3680+
```
3681+
</div>
3682+
35773683
#### CLI options/examples
35783684

35793685

@@ -3987,4 +4093,4 @@ For resellers' users with reseller limits enabled admin should use the <span cla
39874093
```
39884094
cloudlinux-limits set --reseller-name res1 --default all --json
39894095
```
3990-
</div>
4096+
</div>

docs/cloudlinuxos/limits/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,10 @@ End users can monitor their inodes usage through cPanel only (not available on P
391391

392392
End user can also see the usage inside resource usage menu.
393393

394+
::: tip Important Note about Synchronization
395+
When using inode limits with cPanel, please note that changes made through LVE Manager may not be reflected in cPanel user configuration files (<span class="notranslate">`/var/cpanel/users/*`</span>). This is a known limitation where the actual quota enforcement works correctly, but the user files may show outdated limit values. See [Known cl-quota limitations behaviour](/cloudlinuxos/command-line_tools/#known-cl-quota-limitations-behaviour) and [Troubleshooting](/cloudlinuxos/command-line_tools/#troubleshooting) for more details.
396+
:::
397+
394398
## Network traffic bandwidth control and accounting system
395399

396400
:::tip Note
@@ -756,4 +760,4 @@ Possible parameter values:
756760
* lve-wrappers >= 0.7.2
757761
* lvemanager >= 7.5.9
758762
* kmod-lve >= 2.0.36
759-
* lve >= 2.1.2
763+
* lve >= 2.1.2

0 commit comments

Comments
 (0)