Linux下Resin自啟動
Linux下Resin自啟動
轉載:http://blog.sina.com.cn/s/blog_9fd5b6df01012dqb.html
以下摘自Resin的英文參考手冊:
Copy httpd.sh to "resin-a.sh" in resin/bin and change permissions.
Configure JAVA_HOME, RESIN_HOME, PATH, and "-pid" in resin-a.sh.
Check that "resin-a.sh start" and "resin-a.sh stop" work from the command line when running as root.
"ln -s /usr/local/resin/bin/resin-a.sh /etc/rc.d/rc3.d/S86resin-a"
* 如果設定不對,需要刪除,請用命令 rm S86resin-a 刪除連結(注意大小寫)
第一種
-------------------------------------------------------------------------------------------------
#! /bin/sh
#
# ...
#
JAVA_HOME=/usr/java
export JAVA_HOME
RESIN_HOME=/usr/local/resin
export RESIN_HOME
PATH=/bin:/usr/bin:/usr/local/bin
export PATH
args="-Xms75M -Xmx100M start -pid $RESIN_HOME/resin-a.pid"
class=com.caucho.server.http.HttpServer
name=httpd
perl=/usr/local/bin/perl
exec $perl $RESIN_HOME/bin/wrapper.pl -chdir -name "$name" \
-class "$class" $args $*
第二種
--------------------------------------------------------------------------------------------------
#!/bin/sh
# script name: resin
#
# start/stop script for Resin
RESIN_HOME=/usr/resin
JAVA_HOME=/usr/java/jdk1.3
PATH="$PATH:/usr/java/jdk1.3/bin:/usr/X11R6/bin"
export PATH JAVA_HOME RESIN_HOME
${RESIN_HOME}/bin/httpd.sh -Xms75M -Xmx100M \
-java_home ${JAVA_HOME} "$*"