# HG changeset patch # User devi # Date 1135168784 -7200 # Node ID f9447da96f15ba04efeb5fa5cbf2b19e09730e68 # Parent e0db0f8bb48281d978e8989a87ededdfe159b9e6 Исправлены глюки с фильтрами host/user Правильно отрабатывается многократный запуск под FreeBSD Исправлен глюк с автоматическим выделением URL в комментариях diff -r e0db0f8bb482 -r f9447da96f15 l3-agent --- a/l3-agent Sun Dec 18 16:56:09 2005 +0200 +++ b/l3-agent Wed Dec 21 14:39:44 2005 +0200 @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/perl -w # # (c) Igor Chubin, imchubin@mail.ru, 2004-2005 @@ -798,7 +798,7 @@ # Декабрь 2004 год; остальные -- 2005 год. my $year = 2005; - $year = 2004 if ( $cl->{day} > 330 ); + #$year = 2004 if ( $cl->{day} > 330 ); # timelocal( $sec, $min, $hour, $mday,$mon,$year); $cl->{time} = timelocal_nocheck($cl->{sec},$cl->{min},$cl->{hour},$cl->{day},0,$year); @@ -961,13 +961,19 @@ if (open(PIDFILE, $Config{agent_pidfile})) { my $pid = ; close(PIDFILE); - if ( ! -e "/proc/$pid" || !`grep $Config{"l3-agent"} /proc/$pid/cmdline && grep "uid:.*\b$<\b" /proc/$pid/status`) { + if ($^O eq 'linux' && (! -e "/proc/$pid" || !`grep $Config{"l3-agent"} /proc/$pid/cmdline && grep "uid:.*\b$<\b" /proc/$pid/status`)) { print "Removing stale pidfile\n"; unlink $Config{agent_pidfile} or die "Can't remove stale pidfile ". $Config{agent_pidfile}. " : $!"; } + elsif ($^O eq 'freebsd' && !`ps axo uid,pid,command | grep '$<.*$pid.*$Config{"l3-agent"}' 2> /dev/null`) { + } + elsif ($^O eq 'linux' || $^O eq 'freebsd' ) { + print "l3-agent is already running\n"; + exit(0); + } else { - print "l3-agent is already running\n"; + print "Unknown operating system"; exit(0); } } diff -r e0db0f8bb482 -r f9447da96f15 l3-cgi --- a/l3-cgi Sun Dec 18 16:56:09 2005 +0200 +++ b/l3-cgi Wed Dec 21 14:39:44 2005 +0200 @@ -201,7 +201,7 @@ $filter{hostname} = $host if $host; $filter{user} = $user if $user; push @args, ("--filter" => join ("&", (map("$_=$filter{$_}", keys %filter)))); - #push @args, ("--filter" => "hostname=".$host."&user=".$user); + ##push @args, ("--filter" => "hostname=".$host."&user=".$user); } open (FRONTEND, "./l3-frontend --frontend_css $l3config::Config{frontend_css} ".join(" ",map("\"$_\"",@args))." |"); diff -r e0db0f8bb482 -r f9447da96f15 l3-frontend --- a/l3-frontend Sun Dec 18 16:56:09 2005 +0200 +++ b/l3-frontend Wed Dec 21 14:39:44 2005 +0200 @@ -124,7 +124,7 @@ sub close_mywi_socket { - close ($Mywi_Socket); + close ($Mywi_Socket) if $Mywi_Socket ; } @@ -162,7 +162,7 @@ $CommandsFDistribution{$command}++; if (!$Commands_Description{$command}) { my $mywi=""; - $mywi = mywi_client ($command); + $mywi = mywi_client ($command) || ""; $mywi = join ("\n", grep(/\([18]\)/, split(/\n/, $mywi))); $mywi =~ s/\s+/ /; if ($mywi !~ /^\s*$/) { @@ -415,10 +415,11 @@ } for my $filter_key (keys %filter) { - next COMMAND_LINE unless ( - not defined($cl->{local_session_id}) - || not defined($Sessions{$cl->{local_session_id}}->{$filter_key}) - || $Sessions{$cl->{local_session_id}}->{$filter_key} eq $filter{$filter_key}); + next COMMAND_LINE if + defined($cl->{local_session_id}) + && defined($Sessions{$cl->{local_session_id}}->{$filter_key}) + && $Sessions{$cl->{local_session_id}}->{$filter_key} ne $filter{$filter_key}; + #print $filter_key,"\n"; } #if ($filter{user}) { @@ -452,8 +453,8 @@ if ($cl->{class} eq "note") { my $note = $cl->{note}; $note = join ("\n", map ("

$_

", split (/-\n/, $note))); - $note =~ s@(http:[a-zA-Z.0-9/?%-]*)@$1@g; - $note =~ s@(www\.[a-zA-Z.0-9/?%-]*)@$1@g; + $note =~ s@(http:[a-zA-Z.0-9/?\_%-]*)@$1@g; + $note =~ s@(www\.[a-zA-Z.0-9/?\_%-]*)@$1@g; $Result{"body"} .= ""; $Result{"body"} .= "

".$cl->{note_title}."

" if $cl->{note_title}; $Result{"body"} .= "".$note."

"; @@ -602,8 +603,9 @@ if ( $Config{"show_notes"} =~ /^y/i && $cl->{"note"}) { my $note=$cl->{"note"}; $note =~ s/\n/\n/msg; - $note =~ s@(http:[a-zA-Z.0-9/?%-]*)@$1@g; - $note =~ s@(www\.[a-zA-Z.0-9/?%-]*)@$1@g; + if (not $note =~ s@(http:[a-zA-Z.0-9/_?%-]*)@$1@g) { + $note =~ s@(www\.[a-zA-Z.0-9/_?%-]*)@$1@g; + }; # Ширину пока не используем # $Result{"body"} .= ""; $Result{"body"} .= "
"; diff -r e0db0f8bb482 -r f9447da96f15 l3scripts --- a/l3scripts Sun Dec 18 16:56:09 2005 +0200 +++ b/l3scripts Wed Dec 21 14:39:44 2005 +0200 @@ -7,8 +7,8 @@ ###install-pm scp PM/* $ssh_user@$host:/tmp -ssh $ssh_user@$host 'cd /tmp; tar xfz Term-VT102*.gz; cd Term-VT102*[^z]; perl Makefile.PL; make ; make install' -#ssh $ssh_user@$host 'cd /tmp; tar xfz Text-Iconv*.gz; cd Text-Iconv*[^z]; perl Makefile.PL; make ; make install' +#ssh $ssh_user@$host 'cd /tmp; tar xfz Term-VT102*.gz; cd Term-VT102*[^z]; perl Makefile.PL; make ; make install' +ssh $ssh_user@$host 'cd /tmp; tar xfz Text-Iconv*.gz; cd Text-Iconv*[^z]; perl Makefile.PL; make ; make install' ###copy-lablogs for i in $dirs