代碼如下
代碼如下 |
複製代碼 |
[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的官方內建的啟動指令碼的名字變了