Bug#326176: Various problems with starting/stopping via /etc/init/jetty start/stop

Øyvind Harboe oyvind.harboe at zylin.com
Fri Sep 2 08:35:54 UTC 2005


Package: jetty
Version: 5.1.5rc1-2
Severity: important
Tags: patch


  * Fixed rc script /etc/init.d/jetty. "stop" could leave dangling
  /var/run/jetty.pid. Fixed this by adding "--oknodo" to 
  "start-stop-daemon --stop" command
  * Removed trailing "/" from LOGDIR which caused
  /var/log/out.log not to be created.
  * /etc/init.d/jetty start will now deal more gracefully with a 
  dangling /var/run/jetty.pid. A dangling jetty.pid is detected
  and ignored.


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.8-2-386
Locale: LANG=en_US, LC_CTYPE=en_US (charmap=ISO-8859-1)

Versions of packages jetty depends on:
ii  adduser                   3.64           Add and remove users and groups
pn  jikes | j2sdk1.3 | j2sdk1 <none>         (no description available)
ii  libcommons-logging-java   1.0.4-2        The commmon wrapper interface for 
ii  libmx4j-java              2.0.1-4        An open source implementation of t
ii  libservlet2.4-java        5.0.30-2       Servlet 2.4 and JSP 2.0 Java class
ii  libtomcat4-java           4.1.31-3       Java Servlet engine -- core librar
ii  libxerces2-java           2.6.2-2        Validating XML parser for Java wit
ii  sun-j2sdk1.5 [j2re1.5]    1.5.0+update04 Java(TM) 2 SDK, Standard Edition, 

jetty recommends no packages.

-- no debconf information
-------------- next part --------------
Index: changelog
===================================================================
RCS file: /cvsroot/pkg-java/jetty/debian/changelog,v
retrieving revision 1.5
diff -u -r1.5 changelog
--- changelog	30 Aug 2005 12:32:22 -0000	1.5
+++ changelog	2 Sep 2005 07:40:23 -0000
@@ -1,3 +1,16 @@
+
+  * Fixed rc script /etc/init.d/jetty. "stop" could leave dangling
+  /var/run/jetty.pid. Fixed this by adding "--oknodo" to 
+  "start-stop-daemon --stop" command
+  * Removed trailing "/" from LOGDIR which caused
+  /var/log/out.log not to be created.
+  * /etc/init.d/jetty start will now deal more gracefully with a 
+  dangling /var/run/jetty.pid. A dangling jetty.pid is detected
+  and ignored.
+  
+ -- Oyvind Harboe <oyvind.harboe at zylin.com> 
+  
+  	
 jetty (5.1.5rc1-3) unstable; urgency=low
 
   * Removed -v from ant opts during build.
Index: jetty.init
===================================================================
RCS file: /cvsroot/pkg-java/jetty/debian/jetty.init,v
retrieving revision 1.3
diff -u -r1.3 jetty.init
--- jetty.init	30 Aug 2005 12:32:22 -0000	1.3
+++ jetty.init	2 Sep 2005 07:40:24 -0000
@@ -68,7 +68,7 @@
                                                                                 
 # Define other required variables
 PIDFILE="/var/run/$NAME.pid"
-LOGDIR="/var/log/jetty/"
+LOGDIR="/var/log/jetty"
 WEBAPPDIR="$JETTY_HOME/webapps"
 
 ##################################################
@@ -89,23 +89,24 @@
 ##################################################
 case "$1" in
   start)
-        echo -n "Starting $DESC: "
+	if start-stop-daemon --quiet --test --start --pidfile "$PIDFILE" \
+	                --user "$JETTY_USER" --startas "$JAVA" > /dev/null; then 
+
 
-        if [ -f $PIDFILE ]
-        then
-            echo "already running."
-            exit 1
-        fi
 
-	# Look for rotatelogs/rotatelogs2
-	if [ -x /usr/sbin/rotatelogs ]; then
+	    # Look for rotatelogs/rotatelogs2
+	    if [ -x /usr/sbin/rotatelogs ]; then
 		ROTATELOGS=/usr/sbin/rotatelogs
-	else
+	    else
 		ROTATELOGS=/usr/sbin/rotatelogs2
-	fi
+	    fi
 
-	if start-stop-daemon --quiet --test --start --pidfile "$PIDFILE" \
-	                --user "$JETTY_USER" --startas "$JAVA" > /dev/null; then 
+	    if [ -f $PIDFILE ]
+		then
+			echo "$PIDFILE exists, but jetty was not running. Ignoring $PIDFILE"
+	    fi
+
+	    echo -n "Starting $DESC: "
 		su -p -s /bin/sh "$JETTY_USER" \
 			-c "$ROTATELOGS \"$LOGDIR/out.log\" 86400" \
 			< "$LOGDIR/out.log" &
@@ -114,8 +115,9 @@
 			    echo \$!"  > "$PIDFILE"
                 echo "$NAME."
 	else
-                echo "(already running)."
-        fi
+        echo "(already running)."
+		exit 1
+    fi
         ;;
 
   stop)
@@ -132,14 +134,14 @@
 		start-stop-daemon --quiet --stop \
 			--pidfile "$PIDFILE" --user "$JETTY_USER" \
 			--startas "$JAVA" > /dev/null
-                while ! start-stop-daemon --quiet --test --stop \
+                while ! start-stop-daemon --quiet --test --start \
 			--pidfile "$PIDFILE" --user "$JETTY_USER" \
 			--startas "$JAVA" > /dev/null; do 
                         sleep 1
                         echo -n "."
                         JETTY_SHUTDOWN=`expr $JETTY_SHUTDOWN - 1` || true
                         if [ $JETTY_SHUTDOWN -ge 0 ]; then
-				start-stop-daemon --quiet --stop \
+				start-stop-daemon --oknodo --quiet --stop \
 					--pidfile "$PIDFILE" --user "$JETTY_USER" \
 					--startas "$JAVA"
 			else
@@ -184,5 +186,3 @@
 esac
 
 exit 0
-
-


More information about the pkg-java-maintainers mailing list