Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 191611 - Tomcat's init script improvements, both 5.5.x and 6.x [5.5 pending]
Summary: Tomcat's init script improvements, both 5.5.x and 6.x [5.5 pending]
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High enhancement (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords:
: 355493 361235 (view as bug list)
Depends on: 428002
Blocks: 192787 322979
  Show dependency tree
 
Reported: 2007-09-07 16:12 UTC by William L. Thomson Jr. (RETIRED)
Modified: 2012-12-07 13:07 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description William L. Thomson Jr. (RETIRED) gentoo-dev 2007-09-07 16:12:48 UTC
Reminder bug so I don't forget to add a force option to Tomcat's init script, both 5.5.x and 6.x. That way if Java is OOM, or if for some reason can't launch another instance of Java to connect to Tomcat via TCP/IP to tell it to shutdown.
Comment 1 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-10-12 14:30:23 UTC
Also the stop command might benefit from a --retry=60 or other delay for when it takes a while to properly shut down and stop webapps and etc.
Comment 2 William L. Thomson Jr. (RETIRED) gentoo-dev 2007-12-05 01:05:40 UTC
Updated eerror info in gjl version check of 5.5 to mention the problem might be in Tomcat dependencies and to run java-check-environment. Helps resolve issues like 192787.

Also need to capture stderr/stdout in a better manner, that doesn't require s-s-d to keep running. Like that suggested in bug 162379 comment 5. Or as robbat2 suggested, to add System.setErr, System.setOut calls to Tomcat's initial startup. Which seems to be in Bootstrap.java. Not sure if it's set elsewhere during boot, but seems not per how catalina.sh starts Tomcat. Which is what the Gentoo Tomcat init scripts are based on.

Also need to remove classpath inheritance in init when initial classpath is set. Could lead to pollution from the global env if someone sets a global classpath or etc.
Comment 3 Łukasz Damentko (RETIRED) gentoo-dev 2008-10-30 16:21:02 UTC
Reassigning to herd since wltjr has left Gentoo, bug #135927.
Comment 4 Mike Weissman 2009-01-21 23:35:39 UTC
InOverlay

Added one of these improvements to both tomcat:5.5 and tomcat:6 in [java-experimental]

The other improvements are still valid and not implemented, in progress though.

-weisso
Comment 5 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-06-06 12:34:06 UTC
In tomcat-6.0.26-r1, thanks.
Comment 6 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-06-06 12:36:49 UTC
Reopening as 5.5 was not fixed.
Comment 7 William L. Thomson Jr. 2011-02-15 02:40:49 UTC
Actually I think all start/stop/restart is broken in the newer init scripts unless your using openrc which is not stabilized yet I don't believe. When you start, it does start, but init script things it did not. When you go to stop, you can't because it never successfully started, but a forcestop works. Kinda surprised there haven't been more comments as to such, must mean more people are running ~arch, not running Tomcat, or using older versions.
Comment 8 William L. Thomson Jr. 2011-02-17 06:49:05 UTC
A hack might be to add if statement when not using openrc, like was done in previous init scripts, but towards the end. Just to return 0, so its recorded as started regardless of s-s-d output. Not sure why it starts but s-s-d or something things it did not. Now the hack won't necessarily help if it doesn't actually start. But not sure there are many instances or chances of that. Surely not with changes to classpath and other things to ensure Tomcat has a pristine env when starting.
Comment 9 William L. Thomson Jr. 2011-02-23 18:19:41 UTC
A temp fix is to update to openrc 

echo sys-apps/baselayout >> /etc/portage/package.keywords
echo sys-apps/openrc >> /etc/portage/package.keywords

Might need udev as well can't recall.
Comment 10 Jorge Manuel B. S. Vicetto (RETIRED) Gentoo Infrastructure gentoo-dev 2011-02-23 18:52:51 UTC
*** Bug 355493 has been marked as a duplicate of this bug. ***
Comment 11 Thomas Kohler 2011-03-04 18:00:40 UTC
(In reply to comment #9)
> A temp fix is to update to openrc 
> 
> echo sys-apps/baselayout >> /etc/portage/package.keywords
> echo sys-apps/openrc >> /etc/portage/package.keywords
> 
> Might need udev as well can't recall.
> 
Thank you! That help a lot. 
In my case I have migrate two machines without problems. Looking for a other solution takes me 12 hours - migration take 0.5h per machine.

In addition I suggest to read the migration guide.
http://www.gentoo.org/doc/en/openrc-migration.xml
Comment 12 Thomas Kohler 2011-03-04 19:25:29 UTC
(In reply to comment #11)
I forgot: My suggestion for ebuild is to depend tomcat to openrc and baselayout-2. This would save a lot of time.
Comment 13 Serkan Kaba (RETIRED) gentoo-dev 2011-04-01 03:03:18 UTC
*** Bug 361235 has been marked as a duplicate of this bug. ***
Comment 14 Jean-Noël Rivasseau (RETIRED) gentoo-dev 2011-04-05 17:37:13 UTC
I experienced this problem today and commited updated versions of the init script for Tomcat 6.x. It should now start OK even on a stable env without OpenRC (that's what I am running).

Please test and report.
Comment 15 Thomas Kohler 2011-04-05 20:25:39 UTC
Thank you for your work, but where we can found the fixed script?
Comment 16 Jean-Noël Rivasseau (RETIRED) gentoo-dev 2011-04-05 21:00:53 UTC
Just re-emerge the latest version of Tomcat (stable).
Comment 17 Jean-Noël Rivasseau (RETIRED) gentoo-dev 2011-04-08 11:33:08 UTC
Commited again some fixes (with the previous version Tomcat did not log to catalina.out anymore).
Comment 18 Ralph Sennhauser (RETIRED) gentoo-dev 2012-12-07 13:07:43 UTC
The reworked ebuilds went stable. See https://wiki.gentoo.org/wiki/Apache_Tomcat. This should be fixed. Please file a new bug if issues persist. Thanks for the report.