Bug#645221: tomcat6: Tomcat6 initscript influenced by user's environment variables
Nicolas Pichon
nmi3 at free.fr
Thu Oct 13 16:44:17 UTC 2011
Package: tomcat6
Version: 6.0.32-6
Severity: normal
Tags: l10n
Hi,
I use Tomcat6 on several machines running Debian Squeeze and Sid. Some of them are servers using locale en_GB.UTF-8, while my PC is using fr_FR.UTF-8. When I'm connecting on these servers, SSH forwards some environment variables, including LC_ALL.
Here is my PC's locale :
LANG=fr_FR.UTF-8
LANGUAGE=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=fr_FR.UTF-8
And here is the locale on the server when I'm connected to by SSH :
LANG=en_GB.UTF-8
LANGUAGE=en_GB:en
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=fr_FR.UTF-8
This is because Debian's openssh-client package has by default "SendEnv LANG LC_*" in /etc/ssh/ssh_config (which is not the case upstream according to the ssh_config(5) manpage)
After a server restart; if I run a test JSP script which outputs the day of week, I get "Thursday" :
SimpleDateFormat day_of_week = new SimpleDateFormat("EEEEEEEEE");
out.print(day_of_week.format(new java.util.Date()));
If I do a "/etc/init.d/tomcat6 restart", The same page gives "jeudi".
I added a line "unset LC_ALL" in /etc/default/tomcat6 and restarted Tomcat, and the test script gives now "Thursday".
Init scripts should not be influenced by user's environment, and restarting Tomcat by a user should not give a behaviour different to when Tomcat has been started on system boot.
The fix would be to unset LC_ALL variable in the init script provided by the package.
Regards,
Nicolas Pichon.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)
Kernel: Linux 3.0.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to fr_FR.UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages tomcat6 depends on:
ii adduser 3.113
ii debconf [debconf-2.0] 1.5.41
ii tomcat6-common 6.0.32-6
ii ucf 3.0025+nmu2
Versions of packages tomcat6 recommends:
pn authbind <none>
Versions of packages tomcat6 suggests:
ii libtcnative-1 <none>
ii tomcat6-admin 6.0.32-6
ii tomcat6-docs <none>
ii tomcat6-examples 6.0.32-6
ii tomcat6-user 6.0.32-6
-- Configuration Files:
/etc/default/tomcat6 changed [not included]
/etc/logrotate.d/tomcat6 changed [not included]
/etc/tomcat6/catalina.properties changed [not included]
/etc/tomcat6/context.xml changed [not included]
/etc/tomcat6/policy.d/03catalina.policy changed [not included]
/etc/tomcat6/policy.d/50local.policy changed [not included]
/etc/tomcat6/server.xml changed [not included]
/etc/tomcat6/tomcat-users.xml changed [not included]
/etc/tomcat6/web.xml changed [not included]
-- debconf information:
tomcat6/javaopts: -Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC
tomcat6/groupname: tomcat6
tomcat6/username: tomcat6
More information about the pkg-java-maintainers
mailing list