chk启动脚本
#!/bin/bash # chkconfig : 35 99 05 # description: Test chkconfig # file: /etc/init.d/foo env > /tmp/ENVLOG 35 : 就是哪种runlevel下启动 99:在rc3.d和rc5.d下产生S99foo (越小优先权越高) 05: 在rc0.d,rc1.d,rc2.d,rc4.d,rc6.d下产生K05f00 (越小优先权越高) S:代表Start K:代表Kill 1 tomcat #!/bin/sh # chkconfig: 345 99 10 # description: Auto-starts tomcat # /etc/init.d/tomcat # Tomcat auto-start # Source function library. . /etc/init.d/functions # source networking configuration. . /etc/sysconfig/network RETVAL=0 export JAVA_HOME=/usr/java/jdk1.7.0_80 export PATH=$JAVA_HOME/bin:$PATH export CATALINA_HOME=/opt/tomcat-v21 tomcat_pid() {