syslog-ng dying on hup - solved
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
On Tue, 31 Oct 2000 nija@magicaldesk.com wrote:
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.
I use $PROGRAM.log as the logfile name so it would be '.log' which is a valid filename. Yet syslog-ng dies on hangup for me. This can be a solution to one problem, but not to the 'dies on hangup' problem in general. :( -m-
Hi, I'll check it out as soon as I get to the office. Could you send me some messages last transmitted prior to segfaulting? Thanks. -- Bazsi PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1 url: http://www.balabit.hu/pgpkey.txt
participants (3)
-
Balazs Scheidler
-
Hirling Endre
-
nijaļ¼ magicaldesk.com