It seems that /etc/init.d/tomcat-6 need to be updated to work with openrc-0.3 and redirect stdout and stderr to catalina.out via new start-stop-daemon's arguments (namely --background, --stdout and --stderr), instead of doing it via shell redirections.
Created attachment 169542 [details, diff] use s-s-d stderr stdout and background arguments to get catalina.out back will probably work with baselayout-2 only
I wasn't able to re-produce this by: 1. forcing an error by changing a Tomcat Conf.d property 2. starting tomcat 3. start-stop-daemon errors appeared in Catalina.out Can you try: sys-apps/openrc-0.4.0 ? Thanks, Mike
> 1. forcing an error by changing a Tomcat Conf.d property > 2. starting tomcat > 3. start-stop-daemon errors appeared in Catalina.out No need to force an error on ssd, the problem is that *tomcat* outputs does not appear in catalina.out (in fact i did not check where ssd errors go nor should go). When things are working, starting tomcat populates catalina.out with some INFO logs like "INFO: Server startup in 1150 ms", and applications messages and Exceptions printed to stderr at runtime should also appear in catalina.out. When i start tomcat using the provided init script, nothing appears in catalina.out, when i start it with my patched init script, i get expected logs in catalina.out at startup. > Can you try: sys-apps/openrc-0.4.0 ? I can't at the moment as i run a mostly-stable system and openrc-0.4.0 require >=udev-133 which is blocked by cryptsetup-1.0.5-r1 and i don't really want to deal with unstable udev and co. But if you get tomcat startup INFO logs and webapps Exceptions in catalina.out with openrc-0.4.0, i suppose there is nothing to do and this bug should probably be marked WORKSFORME or something. If this is the case, i will eventualy reopen it later if a newer openrc does not fix the problem for me (as soon as i am able to install it).
My Quick test was just to show that i couldn't reproduce Tomcat Stderr from not appearing in the Catalina.out, i tried this because i have had tomcat running in openrc-0.3 for awhile now and it has been logging fine. Have you modified the logging.properties file? Do any of your webapps use a different logging facility? -Mike
(In reply to comment #4) > My Quick test was just to show that i couldn't reproduce Tomcat Stderr from not > appearing in the Catalina.out, I think your test showed that start-stop-daemon's errors were going to catalina.out, not that tomcat's logs were going there too, which is my problem (also it may depends on what conf.d property you changed) Using the original init script and pointing CATALINA_TMPDIR to a non-existant directory, i too get an ssd error in catalina.out. This means that in my case, the bash redirection works for ssd, but for some reason tomcat cannot use it. lsof may provide some clue here : lsof while using original init script : # lsof | grep catalina.out start-sto 30652 root 1w REG 9,4 2803731 6832131 /var/log/tomcat-6/catalina.out start-sto 30652 root 2w REG 9,4 2803731 6832131 /var/log/tomcat-6/catalina.out lsof while using patched init script : # lsof | grep catalina.out java 28604 tomcat 1w REG 9,4 2803410 6832131 /var/log/tomcat-6/catalina.out java 28604 tomcat 2w REG 9,4 2803410 6832131 /var/log/tomcat-6/catalina.out So in the first case ssd owns the file, in the latter case java owns the file. (even if i had no problems, this little difference alone may make the patch a good thing, but this is not the point) > i tried this because i have had tomcat running > in openrc-0.3 for awhile now and it has been logging fine. oops, may be caused by my mostly-stable setup then. I can't compare with other boxes since the faulty one is the only one using openrc. > Have you modified the logging.properties file? No, timestamps shows that this file is unmodified. > Do any of your webapps use a different logging facility? No. Only one webapp here with no logging (only some Exceptions supposed to be thrown to stderr...) This is a quite fresh and simple tomcat setup with no customisation i can remember of except : - GENTOO_VM="sun-jdk-1.6" in /etc/conf.d/tomcat-6 - using tomcat-native-1.1.15
(In reply to comment #5) Are any dated log being created: (Example) -rw-r--r-- 1 tomcat tomcat 3180 Aug 13 18:20 /var/lib/tomcat-6/logs/catalina.2008-08-13.log -rw-r--r-- 1 tomcat tomcat 6372 Aug 14 18:04 /var/lib/tomcat-6/logs/catalina.2008-08-14.log
(In reply to comment #6) > Are any dated log being created: Yes, with expected logs in them : -rw-r--r-- 1 tomcat tomcat 956 2008-12-24 20:23 catalina.2008-12-24.log -rw-r--r-- 1 tomcat tomcat 0 2008-12-24 20:23 catalina.out
(In reply to comment #2) > Can you try: sys-apps/openrc-0.4.0 ? i finally tried openrc-0.4.1-r1 : no change in catalina.out.
Updated $Summary as openrc-0.3 is not in the tree anymore.
Hey, I was able to correctly reproduce this issue. I have submitted 2 fixed ebuilds in [java-experimental] for both tomcat-5.5 and 6 See: https://overlays.gentoo.org/svn/proj/java/java-experimental/www-servers/tomcat/ Please test and let me know, Thanks, Mike
Successfully tested http://overlays.gentoo.org/proj/java/browser/java-experimental/www-servers/tomcat/files/6/tomcat-openrc.init (rev:7391) as a replacement for /etc/init.d/tomcat-6 note: portage changelog dated "20 Dec 2008" for tomcat appears to claim this fix is in the tree but this is not the case.
(In reply to comment #11) Please update to the latest -r6 in [java-experimental] to confirm that this still fixes the problem, then i can try and get this fix pushed into main tree. Thanks, weisso
> Please update to the latest -r6 i did a manual svn checkout of [java-experimental], rev:7602, and installed tomcat-r6. I confirm the problem is still fixed for me. Note that i did not test with <baselayout-2 so i can't tell about start_helper_regular().
I can also confirm this fixes the problem. I am tomcat-6.0.18-r6 from revision 7814 with openrc-0.4.3-r3. It would be great if this could be added to the main tree.
(In reply to comment #14) > It would be great if this could be added to the main tree. As a workaround, you may want to install Tomcat from the main tree and only replace /etc/init.d/tomcat-6 by http://overlays.gentoo.org/proj/java/export/7535/java-experimental/www-servers/tomcat/files/6/tomcat.init.2 to get the openrc fix.
Fixed in 6.0.26-r2. 5.5 still pending I guess?
Give it up, with Tomcat >= 7.x there is no more catalina.out. That stuff is written to the other log files, and if your still relying on catalina.out for some reason. Really need to see about updating your application or something. Its not a good approach, and therefore no longer supported on Gentoo. Sorry if you don't like it!
(In reply to comment #17) > with Tomcat >= 7.x there is no more catalina.out. http://tomcat.apache.org/tomcat-7.0-doc/logging.html " When running Tomcat on unixes, the console output is usually redirected to a file named catalina.out. The name is configurable using an environment variable. (See the startup scripts). Whatever is written to System.err/out will be logged in that file. That may include: * Thread dumps, if you requested them via a system signal * Uncaught exceptions printed by java.lang.ThreadGroup.uncaughtException(..) "
Created attachment 262569 [details, diff] tomcat 7 init.d script with stderr/stdout redirection to catalina.out Here is a trivial patch to the tomcat-7 init.d script currently in portage tree, that do stdout/stderr redirection to catalina.out.
Look catalina.out is NOT coming back, I don't care what the upstream documentation says. You do realize all that stuff is log to another file. Tell me why it needs to be logged twice? You can redirect System.err/out, if you look at sources, pretty sure its already being done. Upstream docs likely need to be updated to reflect that. Either way close this bug as WONTFIX, cause its not going to happen or come back. Its gone for GOOD! Please deal with it!
I agree with wltjr. closing WONTFIX.