When I try to start the tomcat server with the provided init script then the server starts without an error but the init script shows that the server isn't started. Reproducible: Always Steps to Reproduce: 1. /etc/init.d/tomcat-6 start Actual Results: * Starting Tomcat ... [ !! ] Expected Results: * Starting Tomcat ... [ ok ]
Same problem here with tomcat-6.0.28. Some differences I observe: After starting tomcat-6.0.26 with the working init script I see tomcat as a child process of /bin/bash /sbin/runscript.sh /etc/init.d/tomcat-6 start The init scritp of version 6.0.28 shows an error, but tomcat is running without a parent process like above. The init script then does not show the correct status and can not stop tomcat. What additional info is needed to fix this?
Same here. tomcat-6.0.28, baselayout-1.12.13. The cause seems to be that the runscript's start-stop-daemon variant (the one from /lib64/rcscripts/sh/rc-daemon.sh) doesn't recognize the Java process that Bash runs, thus thinks that the daemon did not start successfully and returns a non-zero exit status. The solution is simple: in /etc/init.d/tomcat-6, replace start-stop-daemon ${args} --startas /bin/bash -- -c \ "exec ${exec} ${OPTS_CP} $@ ${CATALINA_ARGS} ${TOMCAT_START} >> \ \"$CATALINA_BASE/logs/catalina.out\" 2>&1" with start-stop-daemon ${args} --name ${exec} --startas /bin/bash -- -c \ "exec ${exec} ${OPTS_CP} $@ ${CATALINA_ARGS} ${TOMCAT_START} >> \ \"$CATALINA_BASE/logs/catalina.out\" 2>&1" (add the --name argument). This will make runscript's start-stop-daemon recognize the process started by Bash with exec. Another solution would be to remove "exec" from this command line. This way, the Bash process would be left hanging waiting for the Java process to finish, and start-stop-daemon would recognize this Bash process as the daemon process. Note that the "native" start-stop-daemon program doesn't have this problem. It either doesn't check that the process still runs, or is able to recognize the process even after Bash does exec.
This affects www-servers/tomcat-6.0.32-r1 as well. The suggestion from Comment #2 resolved the problem.
Thanks for the hint, reporting that 6.0.32-r1 works with the change as per Comment #2. As a note, the start-stop-daemon call in the if just two lines above already has the --exec param, but it was missing from the else.
(In reply to comment #2) > Another solution would be to remove "exec" from this command line. This way, > the Bash process would be left hanging waiting for the Java process to finish, > and start-stop-daemon would recognize this Bash process as the daemon process. Actually, this didn't fix it for me. I had no --exec argument in the command line, but start-stop-daemon never caught the start up. It did hang for a bit, but maybe timeout in any case before tomcat started fully.
6.0.32-r1 went stable now with this bug (amd64)
it was stabilized because of security issues, see bug #329937. i will commit the fix in few mins, just working on it.
fixed in tomcat-6.0.32-r2 (it will take some time till the ebuild reaches portage mirrors). this ebuild is not stable (is ~arch) so you have to unmask it to use it if you are not on ~arch. i used the --name fix. thanks for the fix and feedback.
the fix works for the start command... but now 'stop' has the same problem for me... some ideas?