[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Obscure Tomcat Startup Problem (solved)



On Fri, 2006-09-15 at 16:21 -0400, Darrin Thompson wrote:
> On Fri, 2006-09-15 at 13:32 -0400, Darrin Thompson wrote:
> > The only way I can make this process die:
> > 
> >   * Install tomcat under base-config/tasksel.
> >   * The java invocation must be backgrounded with "&"
> 
> I'm starting to think that the problem is that java is being whacked
> when debconf cleans up its pseudo terminal, since is part of the process
> group.

(Apologies if I've doubled posted by mistake.)

Ok. One way to fix this is to change the tomcat5 init script. Just
prefix the rotatelogs and catalina.sh invocations with nohup and they
survive, even when started under debconf.

Slighly mangled patch:

--- tomcat5-5.0.30.orig/debian/tomcat5.init
+++ tomcat5-5.0.30/debian/tomcat5.init
@@ -141,10 +141,10 @@

                # -p preserves the environment (for $JAVA_HOME etc.)
                # -s is required because tomcat5's login shell
is /bin/false
-               su -p -s /bin/sh $TOMCAT5_USER \
+               nohup su -p -s /bin/sh $TOMCAT5_USER \
                                -c "$ROTATELOGS
\"$CATALINA_BASE/logs/catalina_%F.log\" 86400" \
                                < "$CATALINA_BASE/logs/catalina.out" &
-               su -p -s /bin/sh $TOMCAT5_USER \
+               nohup su -p -s /bin/sh $TOMCAT5_USER \
                        -c "\"$DAEMON\" start $STARTUP_OPTS" \
                        >> "$CATALINA_BASE/logs/catalina.out" 2>&1
                echo "$NAME."

--
Darrin




Reply to: