jsvc最近已发布1.0.6版本,本次更新添加了很多JVM参数的支持,更新功能详列如下:
* DAEMON-209: Add --LibraryPath to procrun for setting the
LoadLibrary serch paths (1.0.6)
* DAEMON-208: Add -server and -client -jvm <name> synonyms (1.0.6)
* DAEMON-205: Add support for building on ARM processors (1.0.6)
* DAEMON-204: Add DaemonSignal interface that allows catching SIGUSR2
signals and creating custom callbacks (1.0.6)
* DAEMON-202: Allow JSVC_OPTS environment variable to be used in
the example Tomcat scripts (1.0.6)
* DAEMON-180: Add DaemonWrapper to allow running standard applications
as daemons. (1.0.4)
* DAEMON-179: Allow procrun to use Java/lang/System as --ShutdownClass. (1.0.4)
* DAEMON-178: Allow jsvc umask to be configured at build time
* DAEMON-177: Allow fail during init with nicer message. (1.0.4)
* DAEMON-176: Create config.nice during configure step. (1.0.4)
* DAEMON-173: Allow --JavaHome=jdk and --JavaHome=jre options that
will guess default JavaHome from the registry. (1.0.4)
* DAEMON-160: Remove obsolete code; rename native/nt as native/windows (1.0.4)
* DAEMON-144: Drop sample dependency on Commons Collections ExtendedProperties (1.0.4)
* DAEMON-95: Support log rotation using SIGUSR1 (1.0.4)
* DAEMON-80: Syslog support for jsvc (1.0.4)
* DAEMON-138: Add --PidFile option to allow storing running process id. (1.0.3)
* DAEMON-137: Add --LogJniMessages allowing to configure JNI verbose message
logging. By default those messages were always logged. (1.0.3)
* DAEMON-140: Add missing Java6 parameters -ea, da, -esa, -dsa, -showversion
and their long name synonyms. (1.0.3)
* DAEMON-142: Add option to display procrun version. (1.0.3)
* DAEMON-166: Add classpath .jar expansion. If the classpath
element ends with asterisk it will evaluate to all .jar files
found in the path. (1.0.3)
* Add -wait and -stop parameters. (1.0.1).
The -wait parameter is experimental: that a is loop testing for a
file in /tmp and waiting n/10 seconds.
* Allow to run as normal user for testing. (1.0.1).
* Initial import to Commons, including the daemon Java API, and jsvc
for Unix and Windows NT/2K/XP, which allows running a Java program
as a native operating system daemon
* Switch to JIRA bug tracking sytem.
* Add sample ProcrunService Java application for use with Procrun Jvm/Java modes (1.0.3)
该工具可以通过简单的一些配置将tomcat放到linux后台服务中运行,针对tomcat 7.0的配置过程如下:
1.首先确保本地已安装JDK,ant,gcc等编译的基本工具,下载jsvc的源代码,解压到$CATALINA_HOME/bin目录,进入commons-daemon-1.0.6-src目录,执行 ant dist命令,可编译生成dist/commons-daemon-1.0.6.jar文件,将其拷贝至$CATALINA_HOME/bin目录,替换原目录中的commons-daemon.jar文件;
2.进入commons-daemon-1.0.6-src/src/native/unix目录,执行
sh ./support/buildconf.sh ./configure --with-java=/your/jdk/home make \cp -rf jsvc $CATALINA_HOME/bin
拷贝:commons-daemon-1.0.6-src/src/samples/Tomcat7.sh
cp commons-daemon-1.0.6-src/src/samples /etc/init.d/tomcat chmod 755 /etc/init.d/tomcat
#!/bin/sh # chkconfig: 2345 10 90 # description: Starts and Stops the Tomcat daemon. JAVA_HOME=/your/jdk/home CATALINA_HOME=/your/apache-tomcat-7.0.16执行:
chkconfig --add tomcat service tomcat start
正常启动后能看到两个PID相连的jsvc进程,打开浏览器,访问http://localhost:8080/,说明配置成功。
更新说明:http://www.linuxidc.com/Linux/2011-07/38545p2.htm
