From c506cad0de6bf98a3bb779fa607adcbb56b476c0 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Fri, 18 Apr 2008 15:07:45 +0200 Subject: [PATCH] Changed pakfire logging facility to syslog and added to core12 --- config/rootfiles/core/12/files | 3 +++ html/cgi-bin/logs.cgi/log.dat | 6 ++++-- html/cgi-bin/pakfire.cgi | 6 ++---- src/pakfire/lib/functions.pl | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/config/rootfiles/core/12/files b/config/rootfiles/core/12/files index bfafdec3f..2ecf1fdf5 100644 --- a/config/rootfiles/core/12/files +++ b/config/rootfiles/core/12/files @@ -134,4 +134,7 @@ lib/modules/2.6.16.57-ipfire-smp/kernel/drivers/usb/net/dm9601.ko srv/web/ipfire/cgi-bin/proxy.cgi srv/web/ipfire/cgi-bin/urlfilter.cgi srv/web/ipfire/cgi-bin/updatexlrator.cgi +srv/web/ipfire/cgi-bin/pakfire.cgi +srv/web/ipfire/cgi-bin/logs.cgi/log.dat +opt/pakfire/lib/functions.pl var/ipfire/langs diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat index 937a4f882..f6f80d175 100644 --- a/html/cgi-bin/logs.cgi/log.dat +++ b/html/cgi-bin/logs.cgi/log.dat @@ -65,7 +65,8 @@ my %sections = ( 'auth' => '(\w+\(pam_unix\)\[.*\]: )', 'kernel' => '(kernel: (?!DROP_))', 'ipsec' => '(ipsec_[\w_]+: |pluto\[.*\]: |vpnwatch: )', - 'openvpn' => '(openvpnserver)\[.*\]: ' + 'openvpn' => '(openvpnserver)\[.*\]: ', + 'pakfire' => '(pakfire:) ' ); # Translations for the %sections array. @@ -76,13 +77,14 @@ my %trsections = ( 'dhcp' => "$Lang::tr{'dhcp server'}", 'cron' => 'Cron', 'collectd' => 'Collectd', - 'clamav' => 'ClamAV', + 'clamav' => 'ClamAV', 'ntp' => 'NTP', 'ssh' => 'SSH', 'auth' => "$Lang::tr{'loginlogout'}", 'kernel' => "$Lang::tr{'kernel'}", 'ipsec' => 'IPSec', 'openvpn' => 'OpenVPN', + 'pakfire' => 'Pakfire', ); diff --git a/html/cgi-bin/pakfire.cgi b/html/cgi-bin/pakfire.cgi index 167f48f73..2a4946375 100644 --- a/html/cgi-bin/pakfire.cgi +++ b/html/cgi-bin/pakfire.cgi @@ -61,7 +61,6 @@ if ($pakfiresettings{'ACTION'} eq 'install'){ if ("$pakfiresettings{'FORCE'}" eq "on") { my $command = "/usr/local/bin/pakfire install --non-interactive --no-colors $pakfiresettings{'INSPAKS'} &>/dev/null &"; system("$command"); - sleep(2); } else { &Header::openbox("100%", "center", "Abfrage"); my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $pakfiresettings{'INSPAKS'}`; @@ -101,7 +100,6 @@ END if ("$pakfiresettings{'FORCE'}" eq "on") { my $command = "/usr/local/bin/pakfire remove --non-interactive --no-colors $pakfiresettings{'DELPAKS'} &>/dev/null &"; system("$command"); - sleep(2); } else { &Header::openbox("100%", "center", "Abfrage"); my @output = `/usr/local/bin/pakfire resolvedeps --no-colors $pakfiresettings{'DELPAKS'}`; @@ -141,8 +139,8 @@ END system("/usr/local/bin/pakfire update --force --no-colors &>/dev/null"); } elsif ($pakfiresettings{'ACTION'} eq 'upgrade') { - - system("/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null"); + my $command = "/usr/local/bin/pakfire upgrade -y --no-colors &>/dev/null"; + system("$command"); refreshpage(); } elsif ($pakfiresettings{'ACTION'} eq "$Lang::tr{'save'}") { diff --git a/src/pakfire/lib/functions.pl b/src/pakfire/lib/functions.pl index 2bce1922c..1080b0062 100644 --- a/src/pakfire/lib/functions.pl +++ b/src/pakfire/lib/functions.pl @@ -93,8 +93,8 @@ sub message { sub logger { my $log = shift; if ($log) { - system("echo \"`date`: $log\" >> /var/log/pakfire.log"); - #system("logger -t pakfire \"$log\""); + #system("echo \"`date`: $log\" >> /var/log/pakfire.log"); + system("logger -t pakfire \"$log\""); } }