diff --git a/jetty-unix.patch b/jetty-unix.patch new file mode 100644 index 0000000..fd52bfb --- /dev/null +++ b/jetty-unix.patch @@ -0,0 +1,83 @@ +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 diff --git a/jetty.init b/jetty.init index 61d4738..d6bceb4 100644 --- a/jetty.init +++ b/jetty.init @@ -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 @@ if [ -z "$JETTY_PID" ]; then 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 @@ start() { 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 @@ start() { 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 @@ case "$1" in stop) stop ;; - restart) + status) + status -p $JETTY_PID jetty + ;; + restart|reload) stop sleep 2 start @@ -148,7 +147,7 @@ case "$1" in fi ;; *) - echo "Usage: $JETTY_PROG {start|stop|restart|condrestart}" + echo "Usage: $0 {start|stop|status|restart|reload|condrestart}" exit 1 esac diff --git a/jetty.spec b/jetty.spec index cf201c2..c8a4c22 100644 --- a/jetty.spec +++ b/jetty.spec @@ -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 @@ Patch1: jetty-PostFileFilter.patch 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 @@ rm src/org/mortbay/util/jmx/MX4JHttpAdaptor.java %patch3 -b .sav %patch4 +%patch5 # Delete this Sun specific file. rm src/org/mortbay/http/SunJsseListener.java @@ -599,6 +601,12 @@ fi %endif %changelog +* Tue Jan 06 2009 Jeff Johnston 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 5.1.14-1.6 - Require tomcat5 bits with proper OSGi metadata