Author: dblevins
Date: Tue Jul 24 00:17:54 2012
New Revision: 1364852

URL: http://svn.apache.org/viewvc?rev=1364852&view=rev
Log:
rewrote doc based on feedback from Tomcat mailing list

Modified:
    openejb/site/trunk/content/unix-daemon.mdtext

Modified: openejb/site/trunk/content/unix-daemon.mdtext
URL: 
http://svn.apache.org/viewvc/openejb/site/trunk/content/unix-daemon.mdtext?rev=1364852&r1=1364851&r2=1364852&view=diff
==============================================================================
--- openejb/site/trunk/content/unix-daemon.mdtext (original)
+++ openejb/site/trunk/content/unix-daemon.mdtext Tue Jul 24 00:17:54 2012
@@ -1,14 +1,51 @@
 Title: Unix Daemon
 
-TomEE can be run as a daemon using the jsvc tool from the commons-daemon 
project. Source tarballs for jsvc are included with the TomEE binaries, and 
need to be compiled. Building jsvc requires a C ANSI compiler (such as GCC), 
GNU Autoconf, and a JDK.
+Apache TomEE can be run as a daemon using the 
[jsvc](http://commons.apache.org/daemon/jsvc.html) tool from the [Apache 
Commons Daemon](http://commons.apache.org/daemon) project.
 
-Before running the script, the `JAVA_HOME` environment variable should be set 
to the base path of the JDK. Alternately, when calling the `./configure` 
script, the path of the JDK may be specified using the `--with-java` parameter, 
such as `./configure --with-java=/usr/java`.
+Source tarballs for `jsvc` are included with Tomcat and therefore can be found 
in TomEE as well.  These need to be compiled before jsvc can be used. 
+Building jsvc requires a C ANSI compiler (such as GCC), GNU Autoconf, and a 
JDK.
 
-Using the following commands should result in a compiled jsvc binary, located 
in the `$TOMEE_HOME/bin` folder. This assumes that GNU TAR is used, and that 
`TOMEE_HOME` is an environment variable pointing to the base path of the TomEE 
installation.
+# Building jsvc
 
-Please note that you should use the GNU make (gmake) instead of the native BSD 
make on FreeBSD systems.
+First, we'll need to locate and unpack the `commons-daemon-native.tar.gz`
 
-# Building
+    cd $TOMEE_HOME/bin
+    tar xzvf commons-daemon-native.tar.gz
+    cd commons-daemon-1.0.7-native-src/unix/
+
+Note that the `commons-daemon-1.0.7-native-src` directory may have a slightly 
different version number.
+
+Second, we'll need to build the `jsvc` binary.  Under a UNIX operating system 
you will need:
+
+ - An ANSI-C compliant compiler (GCC is good)
+ - GNU Make
+ - A Java Platform 2 compliant SDK
+
+You have to specify the `JAVA_HOME` of the SDK either with the 
`--with-java=<dir>` parameter or set the `JAVA_HOME` environment to 
+point to your SDK installation. For example:
+
+    ./configure --with-java=/usr/java
+
+or
+
+    export JAVA_HOME
+    ./configure
+
+If your operating system is supported, configure will go through cleanly, 
otherwise it will report an error (please send us the details of your 
+OS/JDK, or a patch against the sources). To build the binaries and libraries 
simply do:
+
+    make
+
+This will generate the executable file `jsvc`.
+
+Finally, we'll want to set the execution bits and move the `jsvc` binary
+
+    chmod 755 jsvc
+    mv jsvc $TOMEE_HOME/bin
+
+Done!
+
+As one script, the above might look like:
 
     cd $TOMEE_HOME/bin
     tar xzvf commons-daemon-native.tar.gz
@@ -18,8 +55,6 @@ Please note that you should use the GNU 
     chmod 755 jsvc
     mv jsvc ../..
 
-Note that the `commons-daemon-1.0.7-native-src` directory may have a slightly 
different version number.
-
 # Starting (unix)
 
     sudo "$TOMEE_HOME/bin/jsvc" -cp 
"$TOMEE_HOME/bin/bootstrap.jar:$TOMEE_HOME/bin/tomcat-juli.jar" \
@@ -44,7 +79,7 @@ For a 32-bit JVM
 
 Note that `\` at the end of each line is unix syntax to keep everything 
effectively as one line and one command.  The command is simply too long to 
show as one line on a fixed width html page.  The `\` can be removed as long as 
the resulting command is one long line.
 
-# Issues
+# Common Issues
 
 Ensure your `$TOME_HOME` and `$JAVA_HOME` variables are set correctly.  You 
should see similar output with the following two commands
 
@@ -57,8 +92,15 @@ Ensure your `$TOME_HOME` and `$JAVA_HOME
     $ ls $JAVA_HOME
     bin        bundle  lib     man
 
+The `jsvc -debug` option can also show useful information for troubleshooting:
+
+    $TOMEE_HOME/bin/jsvc -debug
+
 Note on OSX, `$JAVA_HOME` should be set to 
`/System/Library/Frameworks/JavaVM.framework/Home`
 
+# Further documentation
 
+See also the full Apache Commons Daemon documentation for jsvc.
 
+  - 
[http://commons.apache.org/daemon/jsvc.html](http://commons.apache.org/daemon/jsvc.html)
 


Reply via email to