[root@client01 ~]# cat /etc/init.d/resind??? #!/bin/sh #created by teddylu at 2014-12-12 #used to startup for resin version 3.1 #chkconfig: 345 85 15 #set up environment variable to fix the failure of resin automatical startup for chkconfig export JAVA_HOME=/application/jdk export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin . /etc/init.d/functions StartPath='/application/resin/bin/httpd.sh' ResinLog=/app/resin/logs/ [ ! -d $ResinLog ] && makedir -p $ResinLog resind() { for id in teddylu do $StartPath -server $id $1 >>$ResinLog/resin_startup.log if [ $? -eq 0 ] then action "resin is $1......" /bin/true else action "resin is $1....." /bin/false fi done } case "$1" in start) resind $1 sleep 10 ;; stop) resind $1 ;; restart) resind stop resind start ;; *) echo "Usage:$0 {status|start|stop|restart}" exit 1 esac exit 0
提示:ressin 3.1可用,4.0待测试,其中,teddylu 是一个服务器的id,即一个实例,如果有多个,可以依次列出,如 teddylu duncan
补充:经过我的测试,该脚本也同样适用于resin4.0
#!/bin/sh
#created by teddylu at 2014-12-12
#used to startup for resin version 4.0
#chkconfig: 345 85 15
#set up environment variable to fix the failure of resin automatical startup for chkconfig
export JAVA_HOME=/application/jdk
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
. /etc/init.d/functions
StartPath=’/application/resin/bin/resin.sh’
ResinLog=/app/resin/logs/
[ ! -d $ResinLog ] && makedir -p $ResinLog
resind()
{
for id in oldboy
do
$StartPath -server $id $1 >>$ResinLog/resin_startup.log
if [ $? -eq 0 ]
then
action “resin is $1……” /bin/true
else
action “resin is $1…..” /bin/false
fi
done
}
case “$1” in
start)
resind $1
sleep 10
;;
stop)
resind $1
;;
restart)
resind stop
resind start
;;
*)
echo “Usage:$0 {start|stop|restart}”
exit 1
esac
exit 0
提示:与3.1不同的就是,4.0的官方内置的启动脚本的名字变了