DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34140>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34140

           Summary: [commons-daemon]: jsvc does not block on Linux
           Product: Commons
           Version: 1.0 Final
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: Daemon
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


Configuration:

Apache/2.0.40 (Red Hat Linux)
mod_jk 1.2.8
Tomcat 5.5.7
Red Hat Linux 9
j2sdk-1_4_2_07


Background:

In a startup script that is executed at boot time and for server restarts,
it is expected that multiple services are started up sequentially, in a single
thread, and any subsequend service is started only after the the previous one in
the sequence has been initialised fully.

The progress status of the startup script is clearly visible at the console
because each segment of the startup script prints the beginning and the end of
each service initialisation and its success or failure response.

Expected behavior:

jsvc should return control to the command prompt or script with the
appropriate return code only after the Java program it executes has
finished its initialisation.

Actual behavior:

jsvc returns immediately.


The expected behavior is much more critical for re-start than at startup.

A re-start is required when adding or deleting virtual hosts.
As an example, an Apache-httpd mod_jserv Tomcat combination requires the
following operational sequence:

1) Apache shutdown (this blocks ok)
2) jsvc Tomcat shutdown (error has impact here)
3) jsvc Tomcat startup (error has impact here)
4) Apache startup (this blocks ok)

2) and 3) true elapse times vary much depending on server load and especially on
the number of virtual hosts.

It is not acceptable to work around this with time delays because their
required duration cannot be determined.

I am using the following script (adapted from the Tomcat distribution):

JAVA_HOME=/usr/java/j2re1.4.2
CATALINA_HOME=/usr/local/tomcat5
DAEMON_HOME=/usr/local/tomcat5/bin
TOMCAT_USER=tomcat
TMP_DIR=/var/tmp
CATALINA_OPTS=
CLASSPATH=\
$JAVA_HOME/lib/tools.jar:\
$CATALINA_HOME/bin/commons-daemon.jar:\
$CATALINA_HOME/bin/bootstrap.jar
TOMCAT_PID_FILE=/var/run/tomcat.pid




case "$1" in
  start)
    #
    # Start Tomcat
    #


    $DAEMON_HOME/jsvc \
    -user $TOMCAT_USER \
    -home $JAVA_HOME \
    -Dcatalina.home=$CATALINA_HOME \
    -Djava.io.tmpdir=$TMP_DIR \
    -outfile $CATALINA_HOME/logs/catalina.out \
    -errfile '&1' \
    $CATALINA_OPTS \
    -cp $CLASSPATH \
    -pidfile $TOMCAT_PID_FILE \
    -debug \
    org.apache.catalina.startup.Bootstrap
    #
    # To get a verbose JVM
    #-verbose \
    # To get a debug of jsvc.
    #-debug \
    ;;

   stop)
    #
    # Stop Tomcat
    #
    #cat $TOMCAT_PID_FILE
    PID=$(cat ${TOMCAT_PID_FILE})
    kill $PID
    ;;

   restart)
    $0 stop
    sleep 2
    $0 start
    ;;

  *)
    echo "Usage tomcat.sh start/stop/restart"
    exit 1;;
esac

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to