HOMEMATCH and cagefs
Hello. Regarding to this doc [url=http://docs.cloudlinux.com/index.html?installation2.html]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?
-
Hello :) Just to confirm, do you not have enough free space (7G) in /usr/share? Thank you. 0 -
Yes, unfortunately - on our servers not enough space in /usr/share 0 -
I get cPanel support answer: " Hello, We apologize for the delay as this had to be tested first. Under testing, if you keep the default option for HOMEMATCH set to home, then user accounts will only create in /home or /home# partitions not within /home#/cagefs-skeleton folder. As such, it does appear that /home7/cagefs-skeleton should not cause user accounts to be created and they should only create within /home7 itself (the base folder) if /home7 has the most space available, and if HOMEMATCH is kept as home rather than blank. Thank you.
" 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./....... 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:/.... # 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 [url=http://docs.cloudlinux.com/index.html?installation2.html:]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.
This is wrong. Without changing this option cpanel will overflow "/" partition and will never create new accounts in incorrect places.0
Please sign in to leave a comment.
Comments
3 comments