The code is as follows
The code is as follows |
Copy Code |
[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
Todo
$StartPath-server $id $ >> $ResinLog/resin_startup.log
If [$?-eq 0]
Then
Action "Resin is $ ..."/bin/true
Else
Action ' resin is $ ... '/bin/false
Fi
Done
}
Case "$" in
Start
Resind $
Sleep 10
;;
Stop
Resind $
;; Restart)
Resind stop
Resind start
;;
*)
echo "usage:$0 {Status|start|stop|restart}"
Exit 1
Esac
Exit 0 |
Tip: Ressin 3.1 available, 4.0 to be tested, where Teddylu is a server ID, an instance, if there are multiple, can be listed in sequence, such as Teddylu Duncan
Add: After my test, the script also applies to resin4.0
The code is as follows |
Copy Code |
#!/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 Todo $StartPath-server $id $ >> $ResinLog/resin_startup.log If [$?-eq 0] Then Action "Resin is $ ..."/bin/true Else Action ' resin is $ ... '/bin/false Fi Done } Case "$" in Start Resind $ Sleep 10 ;; Stop Resind $ ;; Restart) Resind stop Resind start ;; *) echo "usage:$0 {Start|stop|restart}" Exit 1 Esac Exit 0 |
Tip: Unlike 3.1, 4.0 of the official built-in startup script name has changed