Changeset 2177

Show
Ignore:
Timestamp:
06/07/08 11:17:41 (6 months ago)
Author:
mbr
Message:

better support for the ENABLE_SYSLOG_FILE feature to ensure that kmsgsd is not running or queried

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • psad/trunk/psad

    r2170 r2177  
    632632    unless $debug; 
    633633 
    634 ### psad _requires_ that kmsgsd is running to receive any data (unless 
     634### psad requires that kmsgsd is running to receive any data (unless 
    635635### SYSLOG_DAEMON is set to ulogd or psad is configured to acquire data 
    636636### from a normal file via IPT_SYSLOG_FILE), so let's start it here for good 
     
    640640### place to start the other daemons since we just wrote the psad pid 
    641641### to PID_FILE above. 
    642 unless ($config{'ENABLE_SYSLOG_FILE'} eq 'Y') { 
    643     system $cmds{'kmsgsd'} 
    644         unless $no_kmsgsd 
     642unless ($config{'ENABLE_SYSLOG_FILE'} eq 'Y' 
     643        or $no_kmsgsd 
    645644        or $config{'SYSLOG_DAEMON'} =~ /ulog/i 
    646         or $kmsgsd_started; 
     645        or $kmsgsd_started) { 
     646    system $cmds{'kmsgsd'}; 
     647    $kmsgsd_started = 1; 
     648
     649 
     650unless ($kmsgsd_started) { 
     651    my $pid = &is_running($pidfiles{'kmsgsd'}); 
     652 
     653    if ($pid) { 
     654        kill 9, $pid unless kill 15, $pid; 
     655    } 
     656    unlink $pidfiles{'kmsgsd'} if -e $pidfiles{'kmsgsd'}; 
    647657} 
    648658 
     
    14241434                ($pkt_hr->{'flags'} =~ /ACK/ || $pkt_hr->{'flags'} =~ /RST/)) { 
    14251435 
    1426             ###                 $dp > 1024 && ($pkt_hr->{'flags'} =~ /ACK/ || 
     1436            ### $dp > 1024 && ($pkt_hr->{'flags'} =~ /ACK/ || 
    14271437 
    14281438            ### FIXME: ignore TCP packets that have the ACK or RST 
     
    65286538                my $print = 1; 
    65296539                if ($pidname eq 'kmsgsd' 
    6530                         and $config{'SYSLOG_DAEMON'} =~ /ulog/i) { 
     6540                        and ($config{'SYSLOG_DAEMON'} =~ /ulog/i 
     6541                        or $config{'ENABLE_SYSLOG_FILE'} eq 'Y')) { 
    65316542                    $print = 0; 
    65326543                } 
     
    65386549            my $print = 1; 
    65396550            if ($pidname eq 'kmsgsd' 
    6540                     and $config{'SYSLOG_DAEMON'} =~ /ulog/i) { 
     6551                    and ($config{'SYSLOG_DAEMON'} =~ /ulog/i 
     6552                    or $config{'ENABLE_SYSLOG_FILE'} eq 'Y')) { 
    65416553                $print = 0; 
    65426554            } 
     
    77327744                my $print = 1; 
    77337745                if ($pidname eq 'kmsgsd' 
    7734                         and $config{'SYSLOG_DAEMON'} =~ /ulog/i) { 
     7746                        and ($config{'SYSLOG_DAEMON'} =~ /ulog/i 
     7747                        or $config{'ENABLE_SYSLOG_FILE'} eq 'Y')) { 
    77357748                    $print = 0; 
    77367749                } 
     
    77417754            my $print = 1; 
    77427755            if ($pidname eq 'kmsgsd' 
    7743                     and $config{'SYSLOG_DAEMON'} =~ /ulog/i) { 
     7756                    and ($config{'SYSLOG_DAEMON'} =~ /ulog/i 
     7757                    or $config{'ENABLE_SYSLOG_FILE'} eq 'Y')) { 
    77447758                $print = 0; 
    77457759            } 
     
    86788692            my $print = 1; 
    86798693            if ($pidname eq 'kmsgsd' 
    8680                     and $config{'SYSLOG_DAEMON'} =~ /ulog/i) { 
     8694                    and ($config{'SYSLOG_DAEMON'} =~ /ulog/i 
     8695                    or $config{'ENABLE_SYSLOG_FILE'} eq 'Y')) { 
    86818696                $print = 0; 
    86828697            } 
     
    90679082sub restart_kmsgsd() { 
    90689083 
     9084    return if $config{'ENABLE_SYSLOG_FILE'} eq 'Y'; 
    90699085    return if $no_kmsgsd or $config{'SYSLOG_DAEMON'} =~ /ulog/i; 
    90709086    return unless -e $pidfiles{'kmsgsd'};