[smokeping-users] [patch] improve LOCALE error messages to help diagnose system setup issues

Lee Thompson stagr.lee at gmail.com
Sat Aug 28 00:47:00 CEST 2010


Hi smokepinger's

I run smokeping on many boxes and and my Gentoo/Funtoo boxes frequently run
into localization setup issues which will bomb out Smokeping's web
interface.  It works fine invoked from the shell.  I use the attached patch
to help me diagnose the server setup problem.  The behavior is identical to
current Smokeping in that it logs a message and throws a HTTP 500 error.
The basic Smokeping localization sanity check has uncovered "insane" setups
where the PERL %ENV environment variables are being ignored by "setlocale"
on several of my boxes for unknown reasons.  Obviously, smokeping should
quit, which it does...

Here is what I do to get Smokeping up and running in preference order on
linux.

1) check /etc/locale.gen and run "sudo locale-gen"
2) clear the LC_ALL environment variable from the environment (
/etc/profile.env)
3) Set LC_NUMERIC in the mod_perl apache config

<Location /cgi-perl/*.pl>
    SetHandler perl-script
    PerlResponseHandler ModPerl::PerlRun
    Options -Indexes ExecCGI
    PerlSendHeader On
    # for smokeping
    PerlSetEnv LC_NUMERIC C
    Order allow,deny
    Allow from all
</Location>

4) Add "export LC_NUMERIC C" to the apache init script


Recent builds of apache 2.2.15, perl 5.10.1, mod_perl 2.0.4, and libc 2.10.1
are taking the most drastic action which makes me think there is a bad
upstream bug in LOCALE handling.  Even setting "PerlSetEnv LC_ALL C" in the
apache config doesn't work which indicates the perl setlocale() call isn't
working as documented.  I'd be interested in feedback on the patch or
pointers into what else to do to get the locale setup correctly.  I run the
Gentoo recommended LANG="en_US.UTF-8".

Lee Thompson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/smokeping-users/attachments/20100827/3a24a018/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smokeping-2.4.2-locale-msgs.patch
Type: application/octet-stream
Size: 2622 bytes
Desc: not available
Url : http://lists.oetiker.ch/pipermail/smokeping-users/attachments/20100827/3a24a018/attachment.obj 


More information about the smokeping-users mailing list