[Bug 1666570] Re: Post install script has error in RegEx

2017-05-18 Thread Andy Wagner
Tested and verified tomcat7 7.0.52-1ubuntu0.11 and tomcat8
8.0.32-1ubuntu1.4 on Trusty and Xenial.

** Tags added: verification-done-xenial

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1666570

Title:
  Post install script has error in RegEx

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1666570/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1666570] Re: Post install script has error in RegEx

2017-03-07 Thread Andy Wagner
That is an elegant solution, thanks for staying on top of this!

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1666570

Title:
  Post install script has error in RegEx

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1666570/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1666570] Re: Post install script has error in RegEx

2017-03-02 Thread Andy Wagner
Let me know if there is anything further I can do to move this forward.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1666570

Title:
  Post install script has error in RegEx

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1666570/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1666570] Re: Post install script has error in RegEx

2017-02-22 Thread Andy Wagner
You are indeed correct, the culprit is a `%` in the java options of our 
affected servers, one example being:
JAVA_OPTS="-Djava.awt.headless=true 
-XX:ErrorFile=/var/log/tomcat7/java_error%p.log -Xms15025m -Xmx15025m 
-XX:+DisableExplicitGC -XX:+UseG1GC -XX:+UseStringDeduplication"

And for completeness:
$ debconf-show tomcat7
  tomcat7/groupname: tomcat7
  tomcat7/javaopts: -Djava.awt.headless=true 
-XX:ErrorFile=/var/log/tomcat7/java_error%p.log -Xms15025m -Xmx15025m 
-XX:+DisableExplicitGC -XX:+UseG1GC -XX:+UseStringDeduplication
  tomcat7/username: tomcat7

At first blush our solution worked, but this was a side affect of our
configuration management system rewriting the file and camouflaging the
fact that it isn't actually a solution at all!

Anyway, your explanation of what the regular expression is actually trying to 
accomplish leads to what I believe is a relatively trivial use of parameter 
expansion to escape the '%' in the JAVA_OPT environment variable:
| sed "s%^JAVA_OPTS=.*$%JAVA_OPTS=\"${JAVA_OPTS/\%/\\\%}\"%"

I was rather suspicious that this wasn't a known bug already, so I guess
I should have dug deeper originally.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1666570

Title:
  Post install script has error in RegEx

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1666570/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1666570] [NEW] Post install script has error in RegEx

2017-02-21 Thread Andy Wagner
Public bug reported:

Ubuntu 14.04.5 LTS
Tomcat7 7.0.52-1ubuntu0.10

Expected Result
===

When upgrading to a new version of tomcat7, I expect the upgrade to
complete succesfully.

Actual Result
=
When upgrading to a new version of tomcat7, the upgrade fails when running the 
post install script due to an unescaped "$" in a regular expression.

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

The relevant line of regex is here:
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/tomcat7/trusty-security/view/head:/debian/tomcat7.postinst#L25

It appears to also exist in the latest vivid package
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/tomcat7/vivid/view/head:/debian/tomcat7.postinst#L25

Resolution
==

vi /var/lib/dpkg/info/tomcat7.postinst
# change line 25 from:
| sed "s%^JAVA_OPTS=.*$%JAVA_OPTS=\"$JAVA_OPTS\"%" \
# to
| sed "s%^JAVA_OPTS=.*$%JAVA_OPTS=\"\$JAVA_OPTS\"%" \

And then run:
dpkg --configure tomcat7

This I believe may be causing a number of other bug reports such as:
https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1595880
https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1604805

** Affects: tomcat7 (Ubuntu)
 Importance: Undecided
 Status: New

** Description changed:

  Ubuntu 14.04.5 LTS
  Tomcat7 7.0.52-1ubuntu0.10
  
  Expected Result
  ===
  
  When upgrading to a new version of tomcat7, I expect the upgrade to
  complete succesfully.
  
  Actual Result
  =
  When upgrading to a new version of tomcat7, the upgrade fails when running 
the post install script due to an unescaped "$" in a regular expression.
  
  Setting up tomcat7 (7.0.52-1ubuntu0.10) ...
  sed: -e expression #1, char 97: unknown option to `s'
  dpkg: error processing package tomcat7 (--configure):
-  subprocess installed post-installation script returned error exit status 1
+  subprocess installed post-installation script returned error exit status 1
  Errors were encountered while processing:
-  tomcat7
+  tomcat7
  E: Sub-process /usr/bin/dpkg returned an error code (1)
  
  The relevant line of regex is here:
  
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/tomcat7/trusty-security/view/head:/debian/tomcat7.postinst#L25
  
  It appears to also exist in the latest vivid package
  
http://bazaar.launchpad.net/~ubuntu-branches/ubuntu/vivid/tomcat7/vivid/view/head:/debian/tomcat7.postinst#L25
- 
  
  Resolution
  ==
  
  vi /var/lib/dpkg/info/tomcat7.postinst
  # change line 25 from:
  | sed "s%^JAVA_OPTS=.*$%JAVA_OPTS=\"$JAVA_OPTS\"%" \
  # to
  | sed "s%^JAVA_OPTS=.*$%JAVA_OPTS=\"\$JAVA_OPTS\"%" \
  
- And then running:
+ And then run:
  dpkg --configure tomcat7
  
  This I believe may be causing a number of other bug reports such as:
  https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1595880
  https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1604805

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1666570

Title:
  Post install script has error in RegEx

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/tomcat7/+bug/1666570/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs