On both Freebsd 6.1 and Debian...
When db clustering is enabled, all hosts attempt to
perform DB cleaning even though a short hostname is set
in sqlgrey.conf and it doesn't match the actual
hostname of the host.
upon investigation, this section of code seems to be at
fault. On my Systems, it leaves the $HOSTNAME variable
undefined.
>>>>> start code snippet <<<<<<
my $HOSTNAME;
eval { require Sys::Hostname; };
if ($@) { $HOSTNAME = hostname();}
>>>>> end code snippet <<<<<<
Doesn't properly define $HOSTNAME and because of that,
the following section of code below always returns a
"0" Which leaves the cleaning enabled for that this host.
>>>>> start code snippet <<<<<<
if ((defined $HOSTNAME) && (defined
$dflt{db_cleanup_hostname})) {
if ($HOSTNAME eq
$dflt{db_cleanup_hostname}) {
$dflt{dont_db_clean} = 0;
} else {
$dflt{dont_db_clean} = 1;
}
} else {
$dflt{dont_db_clean} = 0;
}
}
>>>>> end code snippet <<<<<<
I used the following to make this feature work
properly. But you might be able to come up with
something more to your liking that will work... or list
the required version of Sys::Hostname.
my $HOSTNAME;
use Sys::Hostname;
$HOSTNAME = hostname();
and I used the FQDN hostname for db_cleanup_hostname
variable in sqlgrey.conf
Todd Florman
tflorman@twtc.net
Logged In: YES
user_id=5889
Originator: NO
Interesting bug ;)..
The purpose of the "eval {}" / "if ($@)" stuff, IS actually to leave hostname blank, if loading of Sys::Hostname failes. (ie. if its not installed).
So its sorta doing as it should, which leads me to a question: Was Sys::Hostname installed while you experienced this?
I run & develop this on Debian myself and i havent experienced this on any of my boxes.. But ill investigate none the less.
Im thinking, assuming you already had Sys::Hostname installed, that maybe "require Sys::Hostname" doesnt always work as i expect. I just couldnt get this trick working with "use" instead.