rpms/jetty/devel jetty-unix.patch, NONE, 1.1 jetty.init, 1.1, 1.2 jetty.spec, 1.8, 1.9

Jeff Johnston jjohnstn at fedoraproject.org
Tue Jan 6 21:58:06 UTC 2009


Author: jjohnstn

Update of /cvs/pkgs/rpms/jetty/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21930

Modified Files:
	jetty.init jetty.spec 
Added Files:
	jetty-unix.patch 
Log Message:

* Tue Jan 06 2009 Jeff Johnston <jjohnstn at redhat.com> 5.1.14-1.7
- Resolves #473585
- Patch init.d script to add status operation
- Patch unix djetty script so it doesn't issue error messages about /dev/tty
  and fix various inconsistencies with the init.d script



jetty-unix.patch:

--- NEW FILE jetty-unix.patch ---
diff -up ./extra/unix/bin/jetty.sh.fix ./extra/unix/bin/jetty.sh
--- ./extra/unix/bin/jetty.sh.fix	2009-01-06 16:01:00.000000000 -0500
+++ ./extra/unix/bin/jetty.sh	2009-01-06 16:03:55.000000000 -0500
@@ -1,4 +1,4 @@
-#!/bin/sh  
+#!/bin/sh
 #
 # Startup script for jetty under *nix systems (it works under NT/cygwin too).
 #
@@ -106,6 +106,13 @@ findDirectory()
     done 
 }
 
+##################################################
+# Check if we have a tty
+##################################################
+have_tty=0
+if [ "`tty`" != "not a tty" ]; then
+    have_tty=1
+fi
 
 ##################################################
 # See if there's a user-specific configuration file
@@ -323,7 +330,7 @@ then
   then
     JETTY_CONSOLE=/dev/console
   else
-    JETTY_CONSOLE=/dev/tty
+    JETTY_CONSOLE=/dev/null
   fi
 fi
 
@@ -356,7 +363,7 @@ then
                 [ -x $J ] || continue
                 VERSION=`eval $J -version 2>&1`       
                 [ $? = 0 ] || continue
-                VERSION=`expr "$VERSION" : '.*"\(1.[0-9\.]*\)"'`
+                VERSION=`expr "$VERSION" : '.*"\(1.[0-9\._]*\)"'`
                 [ "$VERSION" = "" ] && continue
                 expr $VERSION \< 1.2 >/dev/null && continue
                 echo $VERSION:$J
@@ -466,15 +473,15 @@ RUN_CMD="$JAVA $JAVA_OPTIONS -cp $CLASSP
 ##################################################
 case "$ACTION" in
   start)
-        echo "Starting Jetty: "
-
         if [ -f $JETTY_PID ]
         then
             echo "Already Running!!"
             exit 1
         fi
 
-        echo "STARTED Jetty `date`" >> $JETTY_CONSOLE
+	if [ $have_tty -eq 1 ]; then
+          echo "STARTED Jetty `date`" >> $JETTY_CONSOLE
+	fi
 
         nohup sh -c "exec $RUN_CMD >>$JETTY_CONSOLE 2>&1" >/dev/null &
         echo $! > $JETTY_PID
@@ -488,7 +495,9 @@ case "$ACTION" in
         sleep 2
         kill -9 $PID 2>/dev/null
         rm -f $JETTY_PID
-        echo "STOPPED `date`" >>$JETTY_CONSOLE
+        if [ $have_tty -eq 1 ]; then
+          echo "STOPPED `date`" >>$JETTY_CONSOLE
+        fi
         ;;
 
   restart)
@@ -533,9 +542,9 @@ case "$ACTION" in
         echo "RUN_CMD        =  $RUN_CMD"
         echo
         
-        if [ -f $JETTY_RUN/jetty.pid ]
+        if [ -s $JETTY_PID ]
         then
-            echo "Jetty running pid="`cat $JETTY_RUN/jetty.pid`
+            echo "Jetty running pid="`cat $JETTY_PID`
             exit 0
         fi
         exit 1


Index: jetty.init
===================================================================
RCS file: /cvs/pkgs/rpms/jetty/devel/jetty.init,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- jetty.init	30 Aug 2007 19:06:45 -0000	1.1
+++ jetty.init	6 Jan 2009 21:57:36 -0000	1.2
@@ -19,9 +19,7 @@
 
 
 # Source function library.
-if [ -x /etc/rc.d/init.d/functions ]; then
-    . /etc/rc.d/init.d/functions
-fi
+. /etc/init.d/functions
 
 [ -r /etc/java/java.conf ] && . /etc/java/java.conf
 export JAVA_HOME
@@ -54,10 +52,11 @@
 fi
 
 
+prog=jetty
 RETVAL=0
 
 start() {
-    echo -n "Starting $JETTY_PROG: "
+    echo -n $"Starting $prog: "
 
         if [ -f /var/lock/subsys/jetty ] ; then
                 if [ -f $JETTY_PID ]; then
@@ -71,16 +70,13 @@
                 fi
         fi
 
-#        touch $JETTY_PID
-#        chown $JETTY_USER:$JETTY_USER $JETTY_PID
-
 #	[ -x ${JETTY_HOME}/ext ] &&
 #	  	rebuild-jar-repository -s ${JETTY_HOME}/ext
 
         if [ -x /etc/rc.d/init.d/functions ]; then
-                daemon --user $JETTY_USER $JETTY_SCRIPT start
+                daemon --user $JETTY_USER JETTY_PID=$JETTY_PID $JETTY_SCRIPT start
         else
-                su - $JETTY_USER -c "$JETTY_SCRIPT start"
+                su - $JETTY_USER -c "JETTY_PID=$JETTY_PID $JETTY_SCRIPT start"
         fi
 
         RETVAL=$?
@@ -91,20 +87,20 @@
 
 
 stop() {
-    echo -n "Stopping $JETTY_PROG: "
+    echo -n $"Stopping $prog: "
                                                                                                                                                              
     if [ -f /var/lock/subsys/jetty ] ; then
       if [ -x /etc/rc.d/init.d/functions ]; then
-          daemon --user $JETTY_USER $JETTY_SCRIPT stop
+          daemon --user $JETTY_USER JETTY_PID=$JETTY_PID $JETTY_SCRIPT stop
       else
-          su - $JETTY_USER -c "$JETTY_SCRIPT stop"
+          su - $JETTY_USER -c "JETTY_PID=$JETTY_PID $JETTY_SCRIPT stop"
       fi
       RETVAL=$?
 
       if [ $RETVAL = 0 ]; then
         count=0;
 
-        if [ -f /var/run/jetty/jetty.pid ]; then
+        if [ -f $JETTY_PID ]; then
 
             read kpid < $JETTY_PID
             let kwait=$SHUTDOWN_WAIT
@@ -136,7 +132,10 @@
   stop)
         stop
         ;;
-  restart)
+  status)
+	status -p $JETTY_PID jetty
+	;;
+  restart|reload)
         stop
         sleep 2
         start
@@ -148,7 +147,7 @@
         fi
         ;;
   *)
-        echo "Usage: $JETTY_PROG {start|stop|restart|condrestart}"
+        echo "Usage: $0 {start|stop|status|restart|reload|condrestart}"
         exit 1
 esac
                                                                                                                                                              


Index: jetty.spec
===================================================================
RCS file: /cvs/pkgs/rpms/jetty/devel/jetty.spec,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- jetty.spec	12 Aug 2008 15:27:52 -0000	1.8
+++ jetty.spec	6 Jan 2009 21:57:36 -0000	1.9
@@ -54,7 +54,7 @@
 
 Name:           jetty
 Version:        5.1.14
-Release:        1.6%{?dist}
+Release:        1.7%{?dist}
 Summary:        The Jetty Webserver and Servlet Container
 
 Group:          Applications/Internet
@@ -79,6 +79,7 @@
 Patch2:         jetty-libgcj-bad-serialization.patch
 Patch3:         jetty-TestRFC2616-libgcj-bad-date-parser.patch
 Patch4:		jetty-CERT438616-CERT237888-CERT21284.patch
+Patch5:		jetty-unix.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %if ! %{gcj_support}
@@ -254,6 +255,7 @@
 %patch3 -b .sav
 
 %patch4
+%patch5
 
 # Delete this Sun specific file.
 rm src/org/mortbay/http/SunJsseListener.java
@@ -599,6 +601,12 @@
 %endif
 
 %changelog
+* Tue Jan 06 2009 Jeff Johnston <jjohnstn at redhat.com> 5.1.14-1.7
+- Resolves #473585
+- Patch init.d script to add status operation
+- Patch unix djetty script so it doesn't issue error messages about /dev/tty
+  and fix various inconsistencies with the init.d script
+
 * Tue Aug 12 2008 Andrew Overholt <overholt at redhat.com> 5.1.14-1.6
 - Require tomcat5 bits with proper OSGi metadata
 




More information about the fedora-extras-commits mailing list