tomcat6 installation failure on Ubuntu 10.10

Bug #690138 reported by Juha Litola
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tomcat6 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: tomcat6

Tomcat6 installation fails with following error in Ubuntu 10.10.

Setting up tomcat6 (6.0.28-2ubuntu1) ...
sed: -e expression #1, char 102: unknown option to `s'
dpkg: error processing tomcat6 (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 tomcat6
E: Sub-process /usr/bin/dpkg returned an error code (1)

ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: tomcat6 6.0.28-2ubuntu1
ProcVersionSignature: Ubuntu 2.6.32-21.32-server 2.6.32.11+drm33.2
Uname: Linux 2.6.32-21-server x86_64
Architecture: amd64
Date: Tue Dec 14 14:28:08 2010
InstallationMedia: Ubuntu-Server 10.04 LTS "Lucid Lynx" - Release amd64 (20100427)
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/zsh
SourcePackage: tomcat6

Revision history for this message
Juha Litola (juha-litola) wrote :
Revision history for this message
Peter Matulis (petermatulis) wrote :

I tried to confirm but everything went well. From my logs:

-----
Setting up tomcat6 (6.0.28-2ubuntu1) ...

Creating config file /etc/default/tomcat6 with new version
Adding system user `tomcat6' (UID 105) ...
Adding new user `tomcat6' (UID 105) with group `tomcat6' ...
Not creating home directory `/usr/share/tomcat6'.
 * Starting Tomcat servlet engine tomcat6 [ OK ]
-----

Strange.

Revision history for this message
Peter Matulis (petermatulis) wrote :

You seem to be running Lucid. Huh?

Revision history for this message
Juha Litola (juha-litola) wrote : Re: [Bug 690138] Re: tomcat6 installation failure on Ubuntu 10.10

Hi,

I have originally installed server from Lucid, but upgraded it to Maverick later.

% lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.10
Release: 10.10
Codename: maverick

// Juha

On 14.12.2010, at 14.58, Peter Matulis wrote:

> You seem to be running Lucid. Huh?
>
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/690138
>
> Title:
> tomcat6 installation failure on Ubuntu 10.10
>
> Status in “tomcat6” package in Ubuntu:
> New
>
> Bug description:
> Binary package hint: tomcat6
>
> Tomcat6 installation fails with following error in Ubuntu 10.10.
>
> Setting up tomcat6 (6.0.28-2ubuntu1) ...
> sed: -e expression #1, char 102: unknown option to `s'
> dpkg: error processing tomcat6 (--configure):
> subprocess installed post-installation script returned error exit status 1
> Errors were encountered while processing:
> tomcat6
> E: Sub-process /usr/bin/dpkg returned an error code (1)
>
> ProblemType: Bug
> DistroRelease: Ubuntu 10.10
> Package: tomcat6 6.0.28-2ubuntu1
> ProcVersionSignature: Ubuntu 2.6.32-21.32-server 2.6.32.11+drm33.2
> Uname: Linux 2.6.32-21-server x86_64
> Architecture: amd64
> Date: Tue Dec 14 14:28:08 2010
> InstallationMedia: Ubuntu-Server 10.04 LTS "Lucid Lynx" - Release amd64 (20100427)
> PackageArchitecture: all
> ProcEnviron:
> LANG=en_US.UTF-8
> SHELL=/bin/zsh
> SourcePackage: tomcat6
>
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/ubuntu/+source/tomcat6/+bug/690138/+subscribe

Revision history for this message
Soren Hansen (soren) wrote :

Can you provide the output of this command, please?

    sudo debconf-get-selections | grep -i tomcat6

Revision history for this message
Juha Litola (juha-litola) wrote :

Ok, I found the problem.

I have following definition for JAVA_OPTS:

JAVA_OPTS="-Djava.awt.headless=true -Xmx128m -XX:+UseConcMarkSweepGC -DHUDSON_HOME=/DBS/hudson -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=6969 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

postinstall script has this on line 26

                | sed "s/^JAVA_OPTS=.*$/JAVA_OPTS=\"$JAVA_OPTS\"/" \

Now when JAVA_OPTS get expanded, the '/' character ends the regexp and gives sed-failure

sed: -e expression #1, char 102: unknown option to `s'

When I removed JAVA_OPTS from /etc/tomcat6/default, I was able to install the package. So to fix this, value of $JAVA_OPTS would need to be escaped before putting it to sed.

Changed in tomcat6 (Ubuntu):
status: New → Invalid
Revision history for this message
Juha Litola (juha-litola) wrote :

Hi,

I'm not sure whether this is invalid, as it will affect anyone who happens to have '/' character in the JAVA_OPTS, and I guess it is not that rare. Postinstall should escape those strings before it puts them to sed command line. I'm not sed expert, but it could be done with something like below. Or at least one could replace '/' as control character in substitution with '#' or some other rarer character.

juha@intra ~% export BAR=bar
juha@intra ~% echo foo | sed "s/foo/$BAR/"
bar
juha@intra ~% export BAR=bar/bar
juha@intra ~% echo foo | sed "s/foo/`$BAR/"
sed: -e expression #1, char 11: unknown option to `s'
juha@intra ~% echo foo | sed 's/foo/'`echo -n $BAR | sed 's#/#\\\/#g'`'/'
bar/bar

Revision history for this message
Thierry Carrez (ttx) wrote :

Yes, it's a bug, yes, it's already fixed, see bug 654549

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.