You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by no...@apache.org on 2006/07/20 17:20:13 UTC
svn commit: r423953 - in /james/server/trunk: JAMES_PHOENIX.txt build.xml
phoenix-bin/bin/commons-daemon.jar phoenix-bin/bin/james-server.sh
phoenix-bin/bin/jsvc.tar.gz phoenix-bin/bin/phoenix-daemon-loader-0.1.jar
Author: norman
Date: Thu Jul 20 08:20:12 2006
New Revision: 423953
URL: http://svn.apache.org/viewvc?rev=423953&view=rev
Log:
Add support for commons daemon. See JAMES-500
Added:
james/server/trunk/phoenix-bin/bin/commons-daemon.jar (with props)
james/server/trunk/phoenix-bin/bin/james-server.sh (with props)
james/server/trunk/phoenix-bin/bin/jsvc.tar.gz (with props)
james/server/trunk/phoenix-bin/bin/phoenix-daemon-loader-0.1.jar (with props)
Modified:
james/server/trunk/JAMES_PHOENIX.txt
james/server/trunk/build.xml
Modified: james/server/trunk/JAMES_PHOENIX.txt
URL: http://svn.apache.org/viewvc/james/server/trunk/JAMES_PHOENIX.txt?rev=423953&r1=423952&r2=423953&view=diff
==============================================================================
--- james/server/trunk/JAMES_PHOENIX.txt (original)
+++ james/server/trunk/JAMES_PHOENIX.txt Thu Jul 20 08:20:12 2006
@@ -12,6 +12,8 @@
- upgraded wrapper.* files to 3.2.0 release (http://wrapper.tanukisoftware.org/)
+-add new jar for invoke phoenix via commonns daemon.
+
Changed the build.xml to reflect the changes.
Rebuilt.
Modified: james/server/trunk/build.xml
URL: http://svn.apache.org/viewvc/james/server/trunk/build.xml?rev=423953&r1=423952&r2=423953&view=diff
==============================================================================
--- james/server/trunk/build.xml (original)
+++ james/server/trunk/build.xml Thu Jul 20 08:20:12 2006
@@ -175,6 +175,7 @@
<echo message="Phoenix distribution present - adjusting linefeeds and permissions, copying files"/>
<property name="dist.bin" value="${dist.dir}/bin"/>
<fixcrlf srcdir="${phoenix.dir}/bin" includes="phoenix.sh" eol="lf"/>
+
<copy todir="${dist.dir}">
<fileset dir="${phoenix.dir}">
</fileset>
@@ -192,12 +193,14 @@
</fileset>
</copy>
+ <fixcrlf srcdir="${phoenix.dir}/bin" includes="james-server.sh" eol="lf"/>
<fixcrlf srcdir="${dist.bin}" includes="run.sh" eol="lf"/>
<fixcrlf srcdir="${dist.bin}" includes="run.bat" eol="crlf"/>
<chmod perm="+x">
<fileset dir="${dist.bin}">
<include name="run.sh"/>
<include name="phoenix.sh"/>
+ <include name="james-server.sh"/>
</fileset>
</chmod>
Added: james/server/trunk/phoenix-bin/bin/commons-daemon.jar
URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-bin/bin/commons-daemon.jar?rev=423953&view=auto
==============================================================================
Binary file - no diff available.
Propchange: james/server/trunk/phoenix-bin/bin/commons-daemon.jar
------------------------------------------------------------------------------
svn:executable = *
Propchange: james/server/trunk/phoenix-bin/bin/commons-daemon.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: james/server/trunk/phoenix-bin/bin/james-server.sh
URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-bin/bin/james-server.sh?rev=423953&view=auto
==============================================================================
--- james/server/trunk/phoenix-bin/bin/james-server.sh (added)
+++ james/server/trunk/phoenix-bin/bin/james-server.sh Thu Jul 20 08:20:12 2006
@@ -0,0 +1,175 @@
+#! /bin/sh
+#
+# -----------------------------------------------------------------------------
+# Phoenix start script.
+#
+# Author: Alexis Agahi <al...@users.sourceforge.net>
+# Peter Donald <peter at apache.org>
+#
+# Environment Variable Prequisites
+#
+# PHOENIX_OPTS (Optional) Java runtime options used when the command is
+# executed.
+#
+# PHOENIX_TMPDIR (Optional) Directory path location of temporary directory
+# the JVM should use (java.io.tmpdir). Defaults to
+# $PHOENIX_BASE/temp.
+#
+# JAVA_HOME Must point at your Java Development Kit installation.
+#
+# PHOENIX_JVM_OPTS (Optional) Java runtime options used when the command is
+# executed.
+#
+# PHOENIX_KILLDELAY (Optional) When shutting the server this script sends s
+# SIGTERM signal then delays for a time before forcefully
+# shutting down the process if it is still alive. This
+# variable controls the delay and defaults to 5 (seconds)
+#
+# -----------------------------------------------------------------------------
+JSVC=./jsvc
+USER=nobody
+PIDFILE=/var/run/james.pid
+
+
+usage()
+{
+ echo "Usage: $0 {start|stop}"
+ exit 1
+}
+
+[ $# -gt 0 ] || usage
+
+##################################################
+# Get the action & configs
+##################################################
+
+ACTION=$1
+shift
+ARGS="$*"
+
+
+
+# OS specific support. $var _must_ be set to either true or false.
+cygwin=false
+case "`uname`" in
+CYGWIN*) cygwin=true;;
+esac
+
+# resolve links - $0 may be a softlink
+THIS_PROG="$0"
+
+while [ -h "$THIS_PROG" ]; do
+ ls=`ls -ld "$THIS_PROG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '.*/.*' > /dev/null; then
+ THIS_PROG="$link"
+ else
+ THIS_PROG=`dirname "$THIS_PROG"`/"$link"
+ fi
+done
+
+# Get standard environment variables
+PRGDIR=`dirname "$THIS_PROG"`
+PHOENIX_HOME=`cd "$PRGDIR/.." ; pwd`
+
+#setup time between signals to kill phoenix
+if [ -z "$PHOENIX_KILLDELAY" ] ; then
+ PHOENIX_KILLDELAY=5
+fi
+
+
+unset THIS_PROG
+
+if [ -r "$PHOENIX_HOME"/bin/setenv.sh ]; then
+ . "$PHOENIX_HOME"/bin/setenv.sh
+fi
+
+# Checking for JAVA_HOME is required on *nix due
+# to some distributions stupidly including kaffe in /usr/bin
+if [ "$JAVA_HOME" = "" ] ; then
+ echo "ERROR: JAVA_HOME not found in your environment."
+ echo
+ echo "Please, set the JAVA_HOME variable in your environment to match the"
+ echo "location of the Java Virtual Machine you want to use."
+ exit 1
+fi
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched
+if $cygwin; then
+ [ -n "$PHOENIX_HOME" ] && PHOENIX_HOME=`cygpath --unix "$PHOENIX_HOME"`
+fi
+
+if [ -z "$PHOENIX_TMPDIR" ] ; then
+ # Define the java.io.tmpdir to use for Phoenix
+ PHOENIX_TMPDIR="$PHOENIX_HOME"/temp
+ mkdir -p "$PHOENIX_TMPDIR"
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin; then
+ PHOENIX_HOME=`cygpath --path --windows "$PHOENIX_HOME"`
+ PHOENIX_TMPDIR=`cygpath --path --windows "$PHOENIX_TMPDIR"`
+fi
+
+# ----- Execute The Requested Command -----------------------------------------
+
+echo "Using PHOENIX_HOME: $PHOENIX_HOME"
+echo "Using PHOENIX_TMPDIR: $PHOENIX_TMPDIR"
+echo "Using JAVA_HOME: $JAVA_HOME"
+
+# Uncomment to get enable remote debugging
+# DEBUG="-Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"
+#
+# Command to overide JVM ext dir
+#
+# This is needed as some JVM vendors do foolish things
+# like placing jaxp/jaas/xml-parser jars in ext dir
+# thus breaking Phoenix
+#
+JVM_EXT_DIRS="$PHOENIX_HOME/lib:$PHOENIX_HOME/tools/lib"
+if $cygwin; then
+ JVM_EXT_DIRS=`cygpath --path --windows "$JVM_EXT_DIRS"`
+fi
+JVM_OPTS="-Djava.ext.dirs=$JVM_EXT_DIRS"
+
+if [ "$PHOENIX_SECURE" != "false" ] ; then
+ # Make phoenix run with security manager enabled
+ JVM_OPTS="$JVM_OPTS -Djava.security.manager"
+fi
+
+# change to the bin directory
+cd $PHOENIX_HOME/bin
+
+# Get the run cmd
+RUN_CMD="$JSVC -user $USER -pidfile $PIDFILE $JVM_OPTS -outfile $PHOENIX_HOME/logs/james.out -errfile $PHOENIX_HOME/logs/james.err \
+ $JVM_OPTS \
+ $DEBUG \
+ -Djava.security.policy=jar:file:$PHOENIX_HOME/bin/phoenix-loader.jar!/META-INF/java.policy \
+ $PHOENIX_JVM_OPTS \
+ -Dphoenix.home="$PHOENIX_HOME" \
+ -Djava.io.tmpdir="$PHOENIX_TMPDIR" \
+ -cp "$PHOENIX_HOME/bin/phoenix-loader.jar:$PHOENIX_HOME/bin/commons-daemon.jar:$PHOENIX_HOME/bin/phoenix-daemon-loader-0.1.jar" org.apache.avalon.phoenix.launcher.CommonsDaemonLauncher $*"
+
+
+case "$ACTION" in
+ start)
+ #
+ echo "Starting James Server"
+ $RUN_CMD
+ ;;
+
+ stop)
+ #
+ echo "Stopping James Server"
+ kill `cat $PIDFILE`
+ ;;
+
+*)
+ usage
+ ;;
+esac
+
+exit 0
+
+
+
Propchange: james/server/trunk/phoenix-bin/bin/james-server.sh
------------------------------------------------------------------------------
svn:executable = *
Added: james/server/trunk/phoenix-bin/bin/jsvc.tar.gz
URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-bin/bin/jsvc.tar.gz?rev=423953&view=auto
==============================================================================
Binary file - no diff available.
Propchange: james/server/trunk/phoenix-bin/bin/jsvc.tar.gz
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: james/server/trunk/phoenix-bin/bin/phoenix-daemon-loader-0.1.jar
URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-bin/bin/phoenix-daemon-loader-0.1.jar?rev=423953&view=auto
==============================================================================
Binary file - no diff available.
Propchange: james/server/trunk/phoenix-bin/bin/phoenix-daemon-loader-0.1.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org