In a message written on Thu, Dec 19, 2002 at 08:36:40AM +0100, Hellmuth Michaelis wrote: > Syslogd on the machine listens on an "*.syslog" udp4 socket. The machine > is multihomed. The "-s" flag to syslogd is explained as "Do not log > messages from remote machines" - perhaps the perl process is considered > to be remote ?
% uname -r 4.7-RELEASE % ps ax | grep syslog 76 ?? Ss 0:04.80 /usr/sbin/syslogd -s % cat syslogtest #!/usr/bin/perl use Sys::Syslog qw(:DEFAULT setlogsock); setlogsock('unix'); openlog('syslogtest', 'cons,pid', 'mail') || warn "openlog: $!"; syslog('info', 'this should go into the mail log') || warn "syslog: $!"; closelog() || warn "closelog: $!"; setlogsock('inet'); openlog('syslogtest', 'cons,pid', 'mail') || warn "openlog: $!"; syslog('info', 'this should go into the mail log') || warn "syslog: $!"; closelog() || warn "closelog: $!"; % ./syslogtest openlog: at ./syslogtest line 6. closelog: Bad file descriptor at ./syslogtest line 8. openlog: Bad file descriptor at ./syslogtest line 11. closelog: Bad file descriptor at ./syslogtest line 13. I get the exact same behavior on another machine, which insted of -s uses the -a feature (access list) allowing 127.0.0.1, the machine's own IP, and several remote IP's. My test box (that I could run syslog without -s on) is down for the moment, I'll poke at it as soon as it's fixed. That said, everything else on both of these machines syslogs just fine, and since the failure seems to be in openlog (which I believe just creates a unix domain or UDP socket, both of which should succeed even if syslog isn't running) I don't think the security makes a difference. I also find it odd that I can get no error out of openlog, and when I dig into it with the perl debugger I can't tell anything other than it's call to create the socket fails, but I have no idea why. -- Leo Bicknell - [EMAIL PROTECTED] - CCIE 3440 PGP keys at http://www.ufp.org/~bicknell/ Read TMBG List - [EMAIL PROTECTED], www.tmbg.org
msg38766/pgp00000.pgp
Description: PGP signature