The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

HOMEMATCH and cagefs

Discussion in 'CloudLinux' started by alexey_k, Nov 6, 2014.

  1. alexey_k

    alexey_k Member

    Joined:
    Nov 6, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello. Regarding to this doc CloudLinux Documentation

    """On cPanel servers, if you will be placing skeleton into /home directory, you must configure the following option in:
    cPanel WHM WHM -> Server Configuration -> Basic cPanel/WHM Setup -> Basic Config -> Additional home directories
    Change the value to blank (not default "home")
    Without changing this option, cPanel will create new accounts in incorrect places.
    """

    Is it true? How cPanel determine where create new user if I have most free space for example on /home5 and /home5/cagefs-skeleton also presented in /proc/mounts
    I disable HOMEMATCH in /etc/wwwacct.conf for cPanel server. But I want exclude mounts with cagefs-skeleton from HOMEMATCH via regular expression or another method.
    How can I do it?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  3. alexey_k

    alexey_k Member

    Joined:
    Nov 6, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Yes, unfortunately - on our servers not enough space in /usr/share
     
  4. alexey_k

    alexey_k Member

    Joined:
    Nov 6, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I get cPanel support answer:
    """
    """

    Also we do some research in parallel:

    New users are creating using /scripts/wwwacct binary file.
    This file is compiled by perlcc compiler, but after opening it as text and check its content some interesting things can be found.

    Code:
     /.......
     Cpanel::Filesys::get_mount_point_from_device^@^@^@^@Cpanel::Filesys^@Cpanel::Filesys::get_disk_mounts
     ......./
    
     Filesys.pm can be found in /usr/local/cpanel/Cpanel/Filesys.pm
    
     Function get_disk_mounts:
    
     /.......
     sub get_disk_mounts_arrayref {
     my $use_df = shift;
     my $include_virtfs = shift;
     my @mounts;
    
     $Cpanel::Filesys::Info::mount_list_file ||= ( -e '/etc/mtab' && !-z _ && -r _ ) ? '/etc/mtab' : '/proc/mounts';
    
     ..../

    If /etc/mtab exists with non-zero size and its readable then get_disk_mounts takes possible mountpoints from /etc/mtab.

    "if [ -e /etc/mtab ]; then echo 1; fi"
    "if [ ! -z /etc/mtab ]; then echo 1; fi"
    "if [ -r /etc/mtab ]; then echo 1; fi"

    returned 1 with each cpanel server.


    That means that new user will NEVER be installed inside any of mounted cagefs directories (they can be found in /proc/mounts)


    About HOMEMATCH:


    Code:
     /....
     # Respect disabling HOMEMATCH
     if ( !$homematch ) {
     if ($homedir) {
     return ($homedir);
     }
     else {
     if ( -d '/home' ) {
     return ('/home');
     }
     elsif ( -d '/usr/home' ) {
     return ('/usr/home');
     }
     else {
     mkdir '/home', 0755;
     return ('/home');
     }
     }
     }
     ..../
    Regarding CloudLinux Documentation

    This is wrong. Without changing this option cpanel will overflow "/" partition and will never create new accounts in incorrect places.
     
Loading...

Share This Page