[syslog-ng]syslog-ng dying on hup - solved

nija@magicaldesk.com nija@magicaldesk.com
Tue, 31 Oct 2000 08:15:51 -0800


Hello all,

I solved the the problem and I thought I would share the solution with everyone.  The problem was that by logging using $program, occasionally a $program was blank.

Syslog-ng would then try to write the entry to the log file.  And since $program was blank, the log file was the current directory!  I simply added to the filter 'goodprograms' and all was solved.

Below is the full config file.

Cheers,
Nija


# Configuration file for server side syslog-ng
################################################


####################################
# Global options used by syslog-ng
####################################
options { time_reopen     ( 0   );
          sync            ( 0   );
          chain_hostnames ( no  );
          use_dns         ( yes );
          use_fqdn        ( yes );
          };


###########################################
# Global Source statments for the program
###########################################
source src { sun-streams ( "/dev/log" door( "/etc/.syslog_door" ));
             internal    (                                       );
             tcp         ( max-connections( 1000 )               );
             udp         (                                       );
             };

filter goodprograms { not program ("[0-9][0-9]*") or
                      not program (""); };

destination all_messages      {
  file        ( "/var/log/syslog-ng/$YEAR/$MONTH/$DAY/all-messages"
  create_dirs ( yes )
  dir_perm    ( 755 )
  perm        ( 755 )
  );};

destination all_messages2     {
  pipe        ( "/var/adm/nco"
  );};

destination all_program       {
  file        ( "/var/log/syslog-ng/$YEAR/$MONTH/$DAY/$HOST/$PROGRAM"
  create_dirs ( yes  )
  dir_perm    ( 0755 )
  perm        ( 0755 )
  );};

destination all_facility      {
  file        ( "/var/log/syslog-ng/$YEAR/$MONTH/$DAY/$HOST/$FACILITY"
  create_dirs ( yes  )
  dir_perm    ( 0755 )
  perm        ( 0755 )
  );};

destination all_priority      {
  file        ( "/var/log/syslog-ng/$YEAR/$MONTH/$DAY/$HOST/$PRIORITY"
  create_dirs ( yes  )
  dir_perm    ( 0755 )
  perm        ( 0755 )
  );};

destination all_host          {
  file        ( "/var/log/syslog-ng/$YEAR/$MONTH/$DAY/$HOST/messages"
  create_dirs ( yes  )
  dir_perm    ( 0755 )
  perm        ( 0755 )
  );};

destination all_only_program  {
  file        ( "/var/log/syslog-ng/$YEAR/$MONTH/$DAY/program/$PROGRAM"
  create_dirs ( yes  )
  dir_perm    ( 0755 )
  perm        ( 0755 )
  );};

destination all_only_priority {
  file        ( "/var/log/syslog-ng/$YEAR/$MONTH/$DAY/priority/$PRIORITY"
  create_dirs ( yes  )
  dir_perm    ( 0755 )
  perm        ( 0755 )
  );};

destination all_only_facility {
  file        ( "/var/log/syslog-ng/$YEAR/$MONTH/$DAY/facility/$FACILITY"
  create_dirs ( yes  )
  dir_perm    ( 0755 )
  perm        ( 0755 )
  );};

destination all_fac_pri       {
  file        ( "/var/log/syslog-ng/$YEAR/$MONTH/$DAY/facility/$FACILITY.$PRIORITY"
  create_dirs ( yes  )
  dir_perm    ( 0755 )
  perm        ( 0755 )
  );};

destination check_all1        {
  file        ( "/var/log/syslog-ng/all-entries/$HOST"
  create_dirs ( yes  )
  );};

destination check_all2        {
  file        ( "/var/log/syslog-ng/all-entries/$HOST.$PROGRAM"
  );};

destination check_all3        {
  file        ( "/var/log/syslog-ng/all-entries/$HOST.$FACILITY"
  );};

destination check_all4        {
  file        ( "/var/log/syslog-ng/all-entries/$PROGRAM"
  );};

destination check_all5        {
  file        ( "/var/log/syslog-ng/all-entries/$FACILITY"
  );};

log { source( src );                          destination( all_messages      );};
log { source( src );                          destination( all_messages2     );};
log { source( src ); filter ( goodprograms ); destination( all_program       );};
log { source( src ); filter ( goodprograms ); destination( all_facility      );};
log { source( src ); filter ( goodprograms ); destination( all_priority      );};
log { source( src );                          destination( all_host          );};
log { source( src ); filter ( goodprograms ); destination( all_only_program  );};
log { source( src ); filter ( goodprograms ); destination( all_only_priority );};
log { source( src ); filter ( goodprograms ); destination( all_only_facility );};
log { source( src ); filter ( goodprograms ); destination( all_fac_pri       );};
log { source( src ); filter ( goodprograms ); destination( check_all1        );};
log { source( src ); filter ( goodprograms ); destination( check_all2        );};
log { source( src ); filter ( goodprograms ); destination( check_all3        );};
log { source( src ); filter ( goodprograms ); destination( check_all4        );};
log { source( src ); filter ( goodprograms ); destination( check_all5        );};


_____________________________________________________________
Global Virtual Desktop
Get your free Desktop at http://www.magicaldesk.com