Summary: | tomcat init script does not capture std out/err | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | William L. Thomson Jr. (RETIRED) <wltjr> |
Component: | New packages | Assignee: | William L. Thomson Jr. (RETIRED) <wltjr> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | base-system, freakant.relay, hak, java |
Priority: | High | ||
Version: | 2006.1 | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
William L. Thomson Jr. (RETIRED)
2007-01-16 15:47:49 UTC
Well for some reason it did not like that in a variable. But basically ended up tagging on the code displayed. Also mentioned in the forums here, less the last & for backgrounding. http://forums.gentoo.org/viewtopic-t-507085.html Fix committed to tree, closing bug. Please allow time to sync to mirrors I don't think this solves the issue still... I think the problem is coming from the start-stop-daemon utility. Seems that using the --background switch will fork the s-s-d process and redirect all the child's std* FDs to /dev/null. If you search for "background" within the s-s-d source at: http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-src/rc-scripts/src/start-stop-daemon.c?rev=1.5&content-type=text%2Fplain you'll see the process fork itself, setup a /dev/null fd and later use that fd to override the child's stds using dup2(). Not sure why this was written this way. I'm sure there's a very valid reason for doing so. I suggest completely removing the use of s-s-d to solve this issue. Likely have to wait for the newer version of s-s-d. It has a --stdout and I believe --stderr as well. Which we should be able to redirect to catalina.out. I am not sure if it's in ~arch yet. I believe it is, so will see about adding that to the ~arch version. Guess I will re-open bug if it's not fully resolved. Ok a work around for this has been put into place for now. We have dropped --background in favor of & for s-s-d. Only downfall/side effect so far seems to be a running s-s-d process. Oh well price to pay for stdout/stderr at this time. When s-s-d has --stdout/--stderr flags I will switch back to --background and use those to capture/redirect output to catalina.out. Fixed in 5.5.23-r3 and 6.0.13-r1 both were just committed. Please allow time to pass before sync. Closing bug as this has been confirmed by several to work including me :) Another solution would be to use bash with "exec". Then "--background" can be used with s-s-d and we do not have a running s-s-d process. start-helper() { local executor=${1} shift local arguments="--start --quiet --background --chuid ${CATALINA_USER}:${CATALINA_GROUP} \ --make-pidfile --pidfile /var/run/tomcat.pid" args="$@" start-stop-daemon ${arguments} --exec ${executor} --startas /bin/bash -- -c "exec ${executor} ${OPTS_CP} $args ${CATALINA_ARGS} ${TOMCAT_START} >> \"$CATALINA_BASE/logs/catalina.out\" 2>&1" return $? } Thanks I might go with that and will consider it in the mean time. I am waiting on baselayout 2 to hit tree since the version of s-s-d there, has support for --stdout --stderr (In reply to comment #6) > Thanks I might go with that and will consider it in the mean time. I am waiting > on baselayout 2 to hit tree since the version of s-s-d there, has support for > --stdout --stderr > If baselayout 2 is not stable by the next release of Tomcat, I will likely switch over to the method suggested in comment #5. I have a feeling it's going to be a little while before baselayout 2 is stable. Since I don't believe it's even in tree yet. (In reply to comment #7) > If baselayout 2 is not stable by the next release of Tomcat, I will likely > switch over to the method suggested in comment #5. I have a feeling it's going > to be a little while before baselayout 2 is stable. Since I don't believe it's > even in tree yet. baselayout-2 has been in the tree for over 6 months. It's just in package.mask and will be there for a little while longer. |