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

Tomcat4 : "/etc/init.d/tomcat4 stop" won't unload apps properly



Hello,

I use tomcat + apache on a debian box (woody):
apache          1.3.26
j2sdk1.3        1.3.1
tomcat4         4.0.4

I have noticed the following problem in /etc/init.d/tomcat4: when
called with the "stop" argument, it will kill the JVM before the
shutdown of tomcat is correctly ended.

This means that tomcat applications will not be ended correctly:
for instance servlets destroy() methods are not called.

  stop)
	echo -n "Stopping $DESC: "
        if start-stop-daemon --test --start --pidfile "$PIDFILE" \
                --user $TOMCAT4_USER --startas "$JAVA_HOME/bin/java" \
		>/dev/null; then
		echo "(not running)."
	else
		su -p $TOMCAT4_USER -c "\"$DAEMON\" stop" \
			>/dev/null 2>&1 || true
		# Fallback to kill the JVM process in case stopping didn't work
		sleep 2
HERE	>>>	# DOD 31.07.2002 : JVM must not be killed before the tomcat apps are unloaded properly
HERE	>>>	#start-stop-daemon --stop --oknodo --quiet \
HERE	>>>	#	--pidfile "$PIDFILE" --user "$TOMCAT4_USER"
		rm -f "$PIDFILE"
		echo "$NAME."
	fi
	;;

Is there a way to keep the "fallback to kill JVM in case of
problem", but allowing tomcat to stop correctly. I also could
modify the sleep instruction to wait 30s, but...

Should I report a bug to the package maintainer?

Thanks for any help.

Cheers,
-- 
Dominique Deleris
http://potatoworld.tuxfamily.org



Reply to: