From 132e2e1c9f843d45740e13c3f6a5ab6c2203992e Mon Sep 17 00:00:00 2001 From: phildd Date: Fri, 24 Aug 2012 18:07:31 +0545 Subject: Make arpwatch work on 21 and nanobsd On 2.1 arpwatch was putting its log file (arp.dat) into a "pbi" folder where it was installed. arpwatch_reports.php didn't know anything about that, so didn't find it. On nanobsd the usr pbi location is RO anyway. So, arp.dat moved to /var/log Some code added to touch the file from rc.d/arpwatch.sh - arpwatch complains if the file does not exist when it starts. --- config/arpwatch.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/config/arpwatch.xml b/config/arpwatch.xml index 0553eb58..c88480bd 100644 --- a/config/arpwatch.xml +++ b/config/arpwatch.xml @@ -89,11 +89,13 @@ function sync_package_arpwatch() { global $config; - conf_mount_rw(); - config_lock(); + conf_mount_rw(); + config_lock(); + $log_file = "/var/log/arp.dat"; $int = $config['installedpackages']['arpwatch']['config'][0]['interface']; $int = convert_friendly_interface_to_real_interface_name($int); - $start = "/usr/local/sbin/arpwatch -d -i {$int} > /var/log/arpwatch.reports 2>&1 &"; + $start = "touch {$log_file}\n"; + $start .= "/usr/local/sbin/arpwatch -d -f {$log_file} -i {$int} > /var/log/arpwatch.reports 2>&1 &"; $stop = "/usr/bin/killall arpwatch"; write_rcfile(array( "file" => "arpwatch.sh", @@ -102,9 +104,9 @@ ) ); restart_service("arpwatch"); - conf_mount_ro(); - config_unlock(); - } + conf_mount_ro(); + config_unlock(); + } sync_package_arpwatch(); -- cgit v1.2.3