Integrating LVE limits with packages for unsupported control panels

The following documentation should be used to integrate LVE limits with packages for all unsupported panels or even for servers without panels: http://docs.cloudlinux.com/index.html?lve_limits_with_packages.html

Here is an example script and the basic steps.

Before we start:

– the script is simplified as much as possible for better understanding;

– the script works only with one-word package names, without spaces in name;

user_package file logic is not good enough to handle large amount of users/packages (but eventualy this is just an example).

 

 

1. Create the necessary directory and files:

2. The user_package file is just a relation between users and packages, add the following content:

501 Package1
502 BusinessPackage
503 Package1
504 Package1
505 BusinessPackage

3. The custompkg.sh is the main script which will handle all the management. Add the next code to it:

4. Configure LVE to use the custom script: open /etc/sysconfig/cloudlinux and add there:

5. Set some limits for packages:

Check if they has been properly set:

 

ID   SPEED    NCPU    PMEM    VMEM      EP   NPROC      IO
VE_DEFAULT     200       0      0M      0M      20      20       0
BusinessPackage     200       0   2048M      0M      20      20       0
Package1     100       0   1024M      0M      20      20       0

 

6. Check users assignment (is already done by our script):

501 Package1
502 BusinessPackage
503 Package1
504 Package1
505 BusinessPackage

7. Apply limits for all accounts:

     501     100       1    1.0G      0K      20      20       0

 

Leave a Reply

Your email address will not be published. Required fields are marked *