[pkg-java] r2826 - branches/tomcat5.5/feature/debian/debian

Marcus Better marcusb-guest at alioth.debian.org
Thu Nov 30 12:16:36 CET 2006


Author: marcusb-guest
Date: 2006-11-30 12:16:35 +0100 (Thu, 30 Nov 2006)
New Revision: 2826

Modified:
   branches/tomcat5.5/feature/debian/debian/tomcat5.5-admin.prerm
   branches/tomcat5.5/feature/debian/debian/tomcat5.5-webapps.prerm
   branches/tomcat5.5/feature/debian/debian/tomcat5.5.init
Log:
Add try-restart init script action and use it in maintainer scripts.


Modified: branches/tomcat5.5/feature/debian/debian/tomcat5.5-admin.prerm
===================================================================
--- branches/tomcat5.5/feature/debian/debian/tomcat5.5-admin.prerm	2006-11-30 11:02:24 UTC (rev 2825)
+++ branches/tomcat5.5/feature/debian/debian/tomcat5.5-admin.prerm	2006-11-30 11:16:35 UTC (rev 2826)
@@ -4,12 +4,8 @@
 
 case "$1" in
     deconfigure|remove)
-	# Remove the webapp if this is not an upgrade
 	if [ -x /etc/init.d/tomcat5.5 ]; then
-	    # Only restart tomcat if it is already running
-	    if invoke-rc.d tomcat5.5 status >/dev/null; then
-		invoke-rc.d tomcat5.5 force-reload || true
-	    fi
+	    invoke-rc.d tomcat5.5 try-restart || true
 	fi
     ;;
 esac

Modified: branches/tomcat5.5/feature/debian/debian/tomcat5.5-webapps.prerm
===================================================================
--- branches/tomcat5.5/feature/debian/debian/tomcat5.5-webapps.prerm	2006-11-30 11:02:24 UTC (rev 2825)
+++ branches/tomcat5.5/feature/debian/debian/tomcat5.5-webapps.prerm	2006-11-30 11:16:35 UTC (rev 2826)
@@ -4,12 +4,8 @@
 
 case "$1" in
     deconfigure|remove)
-	# Remove the webapp if this is not an upgrade
 	if [ -x /etc/init.d/tomcat5.5 ]; then
-	    # Only restart tomcat if it is already running
-	    if invoke-rc.d tomcat5.5 status >/dev/null; then
-		invoke-rc.d tomcat5.5 force-reload || true
-	    fi
+	    invoke-rc.d tomcat5.5 try-restart || true
 	fi
     ;;
 esac

Modified: branches/tomcat5.5/feature/debian/debian/tomcat5.5.init
===================================================================
--- branches/tomcat5.5/feature/debian/debian/tomcat5.5.init	2006-11-30 11:02:24 UTC (rev 2825)
+++ branches/tomcat5.5/feature/debian/debian/tomcat5.5.init	2006-11-30 11:16:35 UTC (rev 2826)
@@ -183,17 +183,24 @@
 		exit 0
 	fi
         ;;
-  reload)
-	log_failure_msg "Reload is not implemented!"
-	exit 3
-  	;;
   restart|force-reload)
-	$0 stop
-	sleep 1
+        if start-stop-daemon --test --stop --pidfile "$CATALINA_PID" \
+		--user $TOMCAT5_USER --startas "$JAVA_HOME/bin/java" \
+		>/dev/null; then
+		$0 stop
+		sleep 1
+	fi
 	$0 start
 	;;
+  try-restart)
+        if start-stop-daemon --test --start --pidfile "$CATALINA_PID" \
+		--user $TOMCAT5_USER --startas "$JAVA_HOME/bin/java" \
+		>/dev/null; then
+		$0 start
+	fi
+        ;;
   *)
-	log_success_msg "Usage: $0 {start|stop|restart|force-reload|status}"
+	log_success_msg "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
 	exit 1
 	;;
 esac




More information about the pkg-java-commits mailing list