Package: tomcat6
Version: 6.0.24-1
Severity: wishlist
Tags: patch

Please consider adding a trigger which can be used by web application packages 
to restart tomcat after they install or upgrade their files

-- System Information:
Debian Release: 5.0.4
  APT prefers stable
  APT policy: (980, 'stable'), (970, 'stable'), (950, 'testing')
Architecture: i386 (i686)

Kernel: Linux 2.6.30 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
diff -wurN tomcat6-6.0.24/debian/tomcat6.postinst tomcat6-6.0.24.triggers/debian/tomcat6.postinst
--- tomcat6-6.0.24/debian/tomcat6.postinst	2010-01-30 07:39:47.000000000 +0100
+++ tomcat6-6.0.24.triggers/debian/tomcat6.postinst	2010-02-18 14:13:33.326494314 +0100
@@ -2,6 +2,16 @@
 set -e
 
 case "$1" in
+    triggered)
+	if [ "$2" = "tomcat6-restart" ]; then
+		if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
+			invoke-rc.d tomcat6 restart || true
+		else
+			/etc/init.d/tomcat6 restart || true
+		fi
+	fi
+    ;;
+
     configure)
 	if ! id tomcat6 > /dev/null 2>&1 ; then
 	    adduser --system --home /usr/share/tomcat6 --no-create-home \
@@ -34,8 +44,10 @@
     ;;
 esac
 
+if [ "$1" != "triggered" ]; then
 if [ ! -d /var/lib/tomcat6/webapps/ROOT ]; then
     cp -r /usr/share/tomcat6/webapps/default_root /var/lib/tomcat6/webapps/ROOT
 fi
+fi
 
 #DEBHELPER#
diff -wurN tomcat6-6.0.24/debian/tomcat6.triggers tomcat6-6.0.24.triggers/debian/tomcat6.triggers
--- tomcat6-6.0.24/debian/tomcat6.triggers	1970-01-01 01:00:00.000000000 +0100
+++ tomcat6-6.0.24.triggers/debian/tomcat6.triggers	2010-02-18 12:24:15.339046612 +0100
@@ -0,0 +1 @@
+interest tomcat6-restart

Reply via email to