Curious is there any reason /scripts/securetmp caps size of /usr/tmpDSK to 4GB when $tmpdsksize is greater than 4GB ?
I have 42GB free diskspace for /usr partition and it wouldn't let me set 8G for $tmpdsksize due to the code. Guess I just need to change $FOUR_GIG_k value to work around it. But just curious why it's coded this way ?
I have 42GB free diskspace for /usr partition and it wouldn't let me set 8G for $tmpdsksize due to the code. Guess I just need to change $FOUR_GIG_k value to work around it. But just curious why it's coded this way ?
Code:
# Begin securetmp actions
if ( !$tmpmnt ) {
print "Calculating size on /tmp\n";
my $partition_map = {};
my $filesys = Cpanel::DiskLib::get_disk_used_percentage_with_dupedevs();
foreach my $disk ( @{$filesys} ) {
$partition_map->{ $disk->{'mount'} } = $disk->{'available'};
}
my $mount_point = Cpanel::Filesys::find_mount( $filesys, '/usr/tmpDSK' );
my $available = $partition_map->{$mount_point};
my $one_percent_of_available = ( $available * 0.01 );
if ( $one_percent_of_available > $tmpdsksize ) {
$tmpdsksize = $one_percent_of_available;
}
my $FOUR_GIG_k = ( 1024 * 1024 * 4 );
if ( $tmpdsksize > $FOUR_GIG_k ) {
$tmpdsksize = $FOUR_GIG_k;
}
$tmpdsksize = int($tmpdsksize);
$tmpdsksize = $tmpdsksize - ( $tmpdsksize % 1024 );
my $tmpdsksize_megs = ( $tmpdsksize / 1024 );
print "/tmp calculated to be $tmpdsksize_megs M based on available disk space in /usr\n";
Last edited: