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