tomcat not setting correct locales for jvm when started at boot time

Bug #153672 reported by oxi
4
Affects Status Importance Assigned to Milestone
tomcat5.5 (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

Binary package hint: tomcat5.5

tomcat5.5.20-4ubuntu1 Feisty Fawn Ubuntu Server

If started manually it will get correct locale, but it won't when starting at boot time. This is probably caused because locale variables not present before tomcat startup at boot time? Maybe could be fixed by adding "source /etc/default/locale" in startup script? I'm going to try this and report back.

Revision history for this message
oxi (oxiroxt) wrote :

Ouch.

etc/rc2.d/S90tomcat5.5: 29: source: not found

How would one read the variables of /etc/default/locale into the script without having to parse the file? :?

Help please!

Thanks

Revision history for this message
oxi (oxiroxt) wrote :

oh I see... this is caused by sh not having the source command, which is hashed...
Changing the first line of the init script: #!/bin/sh for #!/bin/bash solves the problem. However I don't know whether doing this is correct or even polite...
I'm going to try this again and see if it works.
Be back right now.

Revision history for this message
oxi (oxiroxt) wrote :

Ow, didn't work...

well, i'm all left on your hands

Thanks in advance

Revision history for this message
oxi (oxiroxt) wrote :

Wow, so many days have passed and nobody helps... what's wrong? In Gentoo bugzilla I used to get an answer by the day...

Revision history for this message
Matti Lindell (mlind) wrote :

Hi, do you still have this problem?

You could try adding:
if [ -r /etc/default/locale ]; then
        . /etc/default/locale
        export LANG
fi

in the tomcat5.5 initscript (/etc/init.d/tomcat5.5) somewhere in the beginning where other variables are initialized.

Changed in tomcat5.5:
importance: Undecided → Low
status: New → Invalid
status: Invalid → Incomplete
Revision history for this message
oxi (oxiroxt) wrote :

Yes! That does the trick!!!
Thank you very much! :)))

Revision history for this message
Matti Lindell (mlind) wrote :

Fixed in Debian unstable.

Changed in tomcat5.5:
status: Incomplete → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package tomcat5.5 - 5.5.25-5ubuntu1

---------------
tomcat5.5 (5.5.25-5ubuntu1) hardy; urgency=low

  * Merge from Debian unstable (LP: #153672, LP: #159661, LP: #161882,
    LP: #173692, LP: #179491), remaining changes:
    - debian/control: Change the Maintainer address.
    - debian/rules: Force flag passed to rm to `prune files that should not be
      installed at all'.

tomcat5.5 (5.5.25-5) unstable; urgency=low

  * debian/tomcat5.5.init: Check if tomcat-users.xml exists.
    Thanks to Javier Serrano Polo for the patch. Closes: #445857.
  * debian/tomcat5.5-webapps.postrm: Purge links created in postinst script.
    Closes: #453879.
  * debian/tomcat5.5-admin.links: Fix symlink for commons-io.jar.
    Closes: #452366.
  * debian/tomcat5.5.init: Check user id of the user running the init script.
    Closes: #457956.
  * Renamed /etc/cron.daily/tomcat5.5 to /etc/cron.daily/tomcat55.
    Closes: #454296.
  * debian/tomcat5.5.init: source /etc/default/locale and export LANG so
    tomcat gets started with system locale. Originally reported to
    https://bugs.launchpad.net/ubuntu/+source/tomcat5.5/+bug/153672.

tomcat5.5 (5.5.25-4) unstable; urgency=high

  * CVE-2007-5342: Fix unauthorized modification of data because of
    too open permissions. Closes: #458237.
  * Always clean temporary directory on startup. Closes: #456608.

tomcat5.5 (5.5.25-3) unstable; urgency=low

  * debian/libtomcat5.5-java.links: Removed links for xml-apis.jar and
    xercesImpl.jar. Closes: #443382, #455495.
  * Added libgnumail-java to Build-Depends. Closes: #454312.
  * Updated Standards-Version to 3.7.3.

tomcat5.5 (5.5.25-2) unstable; urgency=high

  [ Michael Koch ]
  CVE-2007-5461:
  * Fix absolute path traversal vulnerability. Closes: #448664.

  [ Marcus Better ]
  * Add required commons-io symlink to the admin webapp, which fixes WAR
    file uploads. (Closes: #452366)
  * debian/control: Use the new Homepage and Vcs-* fields.
  * debian/NEWS: Remove outdated entry.

 -- Matti Lindell <email address hidden> Thu, 03 Jan 2008 20:30:59 +0200

Changed in tomcat5.5:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.