mirror of
https://github.com/webmin/webmin.git
synced 2026-02-28 08:22:30 +00:00
Add a warning if the temp files directory is less than 10 MB
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
Some checks failed
webmin.dev: webmin/webmin / build (push) Has been cancelled
This commit is contained in:
@@ -501,7 +501,9 @@ cswap_file=The swap file $1 does not exist.
|
||||
cswap_size=Create and mount a swap file with size
|
||||
|
||||
acl_sysinfo=Show available disk data on Dashboard?
|
||||
|
||||
sysinfo_total=Total
|
||||
sysinfo_dev=Device ID
|
||||
sysinfo_smalltmp=Warning! The filesystem $2 which contains the Webmin temp files directory $1 has a size of only $4, which is less than the recommended minimum of $3 for temporary and backup files. Consider switching the temp files location to a different directory in the <a href='$5'>Webmin Configuration</a> module.
|
||||
|
||||
__norefs=1
|
||||
|
||||
@@ -76,12 +76,34 @@ foreach my $disk (@$disks) {
|
||||
$dev_id]);
|
||||
}
|
||||
$html .= &ui_columns_end();
|
||||
return ({ 'type' => 'html',
|
||||
'desc' => $desc,
|
||||
'open' => $open,
|
||||
'id' => $module_name . '_disks_info',
|
||||
'html' => $html
|
||||
});
|
||||
my @rv = ({ 'type' => 'html',
|
||||
'desc' => $desc,
|
||||
'open' => $open,
|
||||
'id' => $module_name . '_disks_info',
|
||||
'html' => $html
|
||||
});
|
||||
|
||||
# Check if the filesystem the Webmin temp dir is on is too small
|
||||
my $tmp = $gconfig{'tempdir'} || &default_webmin_temp_dir();
|
||||
my $small = 10*1024*1024*102; # 10 MB
|
||||
foreach my $disk (sort { length($b->{'dir'}) <=> length($a->{'dir'}) } @$disks) {
|
||||
if (&is_under_directory($disk->{'dir'}, $tmp)) {
|
||||
if ($disk->{'total'} <= $small && &foreign_available("webmin")) {
|
||||
push(@rv, { 'type' => 'warning',
|
||||
'level' => 'info',
|
||||
'warning' => &text('sysinfo_smalltmp',
|
||||
"<tt>$tmp</tt>",
|
||||
"<tt>$disk->{'dir'}</tt>",
|
||||
&nice_size($small),
|
||||
&nice_size($disk->{'total'}),
|
||||
&get_webprefix()."/webmin/edit_advanced.cgi"),
|
||||
});
|
||||
}
|
||||
last;
|
||||
}
|
||||
}
|
||||
|
||||
return @rv;
|
||||
}
|
||||
|
||||
sub ucwords
|
||||
|
||||
Reference in New Issue
Block a user