aboutsummaryrefslogtreecommitdiffstats
path: root/config/havp/havp.inc
diff options
context:
space:
mode:
authordvserg <dv_serg@mail.ru>2009-05-12 17:42:45 +0400
committerdvserg <dv_serg@mail.ru>2009-05-12 17:42:45 +0400
commit55705dc89a83cdda1f804ee8eeeb9fea8de7d948 (patch)
treed0f571b554917fb7ca279a4b0c93c865d73e94a9 /config/havp/havp.inc
parentc486e2d192b9a4fcf509daf14841befe7d43bafb (diff)
downloadpfsense-packages-55705dc89a83cdda1f804ee8eeeb9fea8de7d948.tar.gz
pfsense-packages-55705dc89a83cdda1f804ee8eeeb9fea8de7d948.tar.bz2
pfsense-packages-55705dc89a83cdda1f804ee8eeeb9fea8de7d948.zip
Havp RAMdisk bug fixed.
Signed-off-by: dvserg <dv_serg@mail.ru>
Diffstat (limited to 'config/havp/havp.inc')
-rw-r--r--config/havp/havp.inc31
1 files changed, 14 insertions, 17 deletions
diff --git a/config/havp/havp.inc b/config/havp/havp.inc
index 14e75484..2505ce0b 100644
--- a/config/havp/havp.inc
+++ b/config/havp/havp.inc
@@ -184,13 +184,15 @@ function havp_install()
function havp_deinstall()
{
havp_setup_cron(HVDEF_CLAM_UPD_CRONNAME,"", "");
+ mwexec("killall -9 havp");
mwexec("rm -rf " . HVDEF_HAVP_STARTUP_SCRIPT);
- mwexec("rm -rf " . HVDEF_CLAM_STARTUP_SCRIPT);
- mwexec("rm -rf " . HVDEF_AVUPD_SCRIPT);
mwexec("rm -rf " . HVDEF_FILTER_RESYNC_SCRIPT);
mwexec("rm -rf " . HVDEF_PID_FILE);
- mwexec("rm -rf " . HVDEF_CLAM_PID);
- mwexec("rm -rf " . HVDEF_CLAM_SOCKET);
+# mwexec("rm -rf " . HVDEF_CLAM_STARTUP_SCRIPT);
+# mwexec("rm -rf " . HVDEF_AVUPD_SCRIPT);
+# mwexec("rm -rf " . HVDEF_CLAM_PID);
+# mwexec("rm -rf " . HVDEF_CLAM_SOCKET);
+ umountRAMDisk();
}
# ==============================================================================
# Events
@@ -1282,17 +1284,12 @@ function mountRAMdisk($free_and_mount = true)
# =-= Temp RAMDisk =-=
# note: use 1/4 of system memory capacity
$ramdisk_capacity = get_memory();
- $ramdisk_capacity = intval($ramdisk_capacity[0]) / 4; # [Mb]
-
- # check RAMDisk for exists and capacity
- if (file_exists($mnt_flag_file)) {
- $old_ramdisk_size = trim(file_get_contents($mnt_flag_file));
- # RAMDisk exists - not need create new
- if (intval($ramdisk_size) === intval($old_ramdisk_size)) return;
- }
+ $ramdisk_capacity = intval(intval($ramdisk_capacity[0]) / 4); # [Mb]
+ # RAMDisk already exists?
+ if (file_exists("/dev/md10")) return;
# umount old RAMDisk
- umountRAMDisk();
+# umountRAMDisk();
# create and mount a swap backed file system on /var/tmp/havp by /dev/md10:
# SWAP
@@ -1300,11 +1297,11 @@ function mountRAMdisk($free_and_mount = true)
# mwexec("newfs -U /dev/md10");
# mwexec("mount /dev/md10 $mnt_point");
# RAM - more quickly, used physical RAM
- mwexec("/sbin/mdmfs -s {$ramdisk_capacity}M md10 $mnt_point");
- mwexec("chmod 1777 $mnt_point");
+ mwexec("/sbin/mdmfs -s {$ramdisk_capacity}M md10 {$mnt_point}");
+ mwexec("chmod 1777 {$mnt_point}");
# create flag file
- file_put_contents($mnt_flag_file, "$ramdisk_capacity");
+ file_put_contents($mnt_flag_file, "{$ramdisk_capacity}");
# syslog
if (HV_DEBUG === 'true')
log_error("havp: Create RAMDisk {$ramdisk_capacity}Mb.");
@@ -1433,7 +1430,7 @@ function havp_fix()
if (isset($config['installedpackages']['menu'])) {
foreach($config['installedpackages']['menu'] as $mkey => $mval) {
if ($mval['name'] === 'HTTP Antivirus') {
- unset($config['installedpackages']['menu'][$key]);
+ unset($config['installedpackages']['menu'][$mkey]);
write_config('Fix HAVP menu.');
break;
}