日期:2014-05-16 浏览次数:20738 次
#!/bin/bash # Comments to support LSB init script conventions ### BEGIN INIT INFO # Provides: tomcat # Required-Start: $ALL # Required-Stop: $ALL # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: start and stop ORS # Description: tomcat ORS SERVER ### END INIT INFO export JAVA_HOME=/usr/soft/jdk1.6.0_26 case $1 in 'start') echo -n "Starting tomcat..." /usr/tomcat7/tomcat/bin/startup.sh echo " done" ;; 'stop') echo -n "Stopping tomcat..." /usr/tomcat7/tomcat/bin/shutdown.sh echo " done" ;; 'restart') /usr/tomcat7/tomcat/bin/shutdown.sh sleep 5 /usr/tomcat7/tomcat/bin/startup.sh ;; *) echo -n "Usage: $0 {start|restart|stop}" ;; esac
?