Skip Menu |

This queue is for tickets about the Sys-Syslog CPAN distribution.

Report information
The Basics
Id: 19622
Status: resolved
Priority: 0/
Queue: Sys-Syslog

People
Owner: SAPER [...] cpan.org
Requestors: matsj [...] init.se
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.13
  • 0.14
Fixed in: (no value)



Subject: localhost instead of hostname is logged in Solaris/HP-UX
Affected perl version 5.8.8. Not present in earlier perl versions (containing ver 0.12 or less). In Solaris 10 (Intel) and HP-UX 11.11 PA-RISC the following rows appears in syslog: <time> localhost <app>: <msg> In earlier perl versions rows appeared as: <time> <hostname> <app>: <msg> The behaviour seems to be platform dependent since in FreeBSD 6 and SuSE (SLES 9) log rows appears as: <time> <hostname> <app>: <msg> I guess the behavior comes from the removal of the $host=hostname() in the code between ver 0.12 and 0.13 and setting $that=INADDR_LOOPBACK if $host is not defined? Although I can't explain the differences between the platforms. One workaround is ofcourse to use Sys::Hostname; $Sys::Syslog::host=hostname(); to get the same behaviour on all platforms. /Mats
Subject: Re: [rt.cpan.org #19622] localhost instead of hostname is logged in Solaris/HP-UX
Date: Fri, 2 Jun 2006 01:25:09 +0200
To: bug-Sys-Syslog [...] rt.cpan.org
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Show quoted text
> Affected perl version 5.8.8. Not present in > earlier perl versions (containing ver 0.12 or less). > > In Solaris 10 (Intel) and HP-UX 11.11 PA-RISC > the following rows appears in syslog: > <time> localhost <app>: <msg> > > In earlier perl versions rows appeared as: > <time> <hostname> <app>: <msg>
I'e say this is a bug/feature of your syslog daemon as the syslog messages sent by Sys::Syslog doesn't contain the hostname. This is a formatting issue of the syslog daemon. Show quoted text
> The behaviour seems to be platform dependent since > in FreeBSD 6 and SuSE (SLES 9) log rows appears as: > <time> <hostname> <app>: <msg> > > I guess the behavior comes from the removal of the > $host=hostname() in the code between ver 0.12 and 0.13 > and setting $that=INADDR_LOOPBACK if $host is not defined? > Although I can't explain the differences between the > platforms.
This change was made by Nicholas Clark (and approved by many others) in order to simplify this part of the code because it was complex and failed in strange ways in several cases. Mainly because a machine can have an unresolvable hostname. See his mail in ticket RT#16980: http://rt.cpan.org/Ticket/Display.html?id=16980#txn-153997 Show quoted text
> One workaround is ofcourse to > use Sys::Hostname; $Sys::Syslog::host=hostname(); to get the > same behaviour on all platforms.
Sys::Hostname usage was removed because it provides no warranty with regard to the reliability of the result, and therefore isn't portable across platforms. See previous explanation. Sébastien Aperghis-Tramoni -- - --- -- - -- - --- -- - --- -- - --[ http://maddingue.org ] Close the world, txEn eht nepO
CC: bug-Sys-Syslog [...] rt.cpan.org, hookan [...] init.se
Subject: Re: [rt.cpan.org #19622] localhost instead of hostname is logged in Solaris/HP-UX
Date: Mon, 17 Sep 2007 08:31:29 +0200
To: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
From: Mats Joensson <matsj [...] init.se>
Hi, Thank you for the information. From what I remember we did a workaround in the code, but I'll pass the information on. Regards, /Mats Sébastien Aperghis-Tramoni wrote: Show quoted text
> Hello, > > > I didn't heard anything back from you. Did you try upgrading Sys::Syslog > to a more recent version? Since 0.15, there's support for using the > native Unix mechanism, which make Perl programs look like any other > standard Unix programs WRT syslog. > > Don't hesitate to ask if you have any question. > > > Regards > > --Sébastien Aperghis-Tramoni > > Close the world, txEn eht nepO. >
CC: bug-Sys-Syslog [...] rt.cpan.org, hookan [...] init.se
Subject: Re: [rt.cpan.org #19622] localhost instead of hostname is logged in Solaris/HP-UX
Date: Mon, 17 Sep 2007 08:54:32 +0200
To: Mats Joensson <matsj [...] init.se>
From: Sébastien Aperghis-Tramoni <saper [...] cpan.org>
Mats Joensson wrote: Show quoted text
> Hi,
Hello, Show quoted text
> Thank you for the information. > > From what I remember we did a workaround in the code, but I'll pass > the > information on.
Ok, then I'll close this ticket. Don't hesitate to open a new one of you encounter a new problem. Regards -- Sébastien Aperghis-Tramoni Close the world, txEn eht nepO.