Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

/scripts/securetmp and /usr/tmpDSK capped at 4GB /tmp

Discussion in 'General Discussion' started by eva2000, Oct 11, 2012.

  1. eva2000

    eva2000 Well-Known Member

    Joined:
    Aug 14, 2001
    Messages:
    330
    Likes Received:
    13
    Trophy Points:
    318
    Location:
    Brisbane, Australia
    cPanel Access Level:
    Root Administrator
    Twitter:
    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 ?

    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";
     
    #1 eva2000, Oct 11, 2012
    Last edited: Oct 11, 2012
  2. DestoMedia

    DestoMedia Member

    Joined:
    Jul 12, 2007
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    51
    We're running into the same issue, why is it capped and can we just change the $FOUR_GIG_K value as work around?
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,715
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice