Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 457520 - init script for www-servers/tomcat-7.0.32 drops STDOUT and STDERR
Summary: init script for www-servers/tomcat-7.0.32 drops STDOUT and STDERR
Status: RESOLVED DUPLICATE of bug 451140
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Java team
Keywords: PATCH
Depends on:
Reported: 2013-02-14 12:49 UTC by Joe Breuer
Modified: 2013-10-16 14:01 UTC (History)
1 user (show)

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

Patch to redirect STDOUT/STDERR into $CATALINA_OUT / $CATALINA_ERR (tomcat-stdout+stderr.patch,427 bytes, text/plain)
2013-02-14 12:49 UTC, Joe Breuer

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Breuer 2013-02-14 12:49:57 UTC
Created attachment 338860 [details]

The current init script for www-servers/tomcat-7.0.32 (installed in /usr/share/tomcat-7/gentoo/tomcat.init, managed by /usr/share/tomcat-7/gentoo/tomcat-instance-manager.bash) causes tomcat's STDOUT and STDERR to be lost.

This makes debugging certain issues (like: why does my log setup not work/the app not start at all?) quite frustrating.

Upstream's by default redirects STDOUT and STDERR of the server process to .../logs/catalina.out.

I've attached a patch which enables this behavior in the tomcat.init script, by introducing new configurations variables "CATALINA_OUT" and "CATALINA_ERR".
While doing this, I've split STDOUT and STDERR into separate targets. I *think* there should be no problem redirecting them both into the same file; but I haven't tried that.

The new variables could be accompanied by some descriptive text in the config file template (/usr/share/tomcat-7/gentoo/tomcat.conf):


# File locations for the server's STDOUT and STDERR
# if unset/empty, the respective output channel is lost


I'm not too familiar with what parts of bash syntax are considered "good" or "bad" in init scripts, so I'd suggest someone with the appropriate init-script-fu looks over the patch before it gets applied.
Comment 1 Pavel Goran 2013-06-02 16:21:04 UTC
This is a problem for me, as well. For example, I can't use slf4j-simple for logging purposes without additional configuration.
Comment 2 Tiziano Müller (RETIRED) gentoo-dev 2013-10-16 14:01:40 UTC

*** This bug has been marked as a duplicate of bug 451140 ***