美文网首页
centos6.5开机自启动脚本

centos6.5开机自启动脚本

作者: liuweiiii | 来源:发表于2017-03-01 12:41 被阅读0次

示例:tomcat


#!/bin/bash

#chkconfig:2345  80  05

start(){

 /bin/bash  /usr/local/apache-tomcat/bin/startup.sh

}


stop(){

/bin/bash /usr/local/apache-tomcat/bin/shutdown.sh

}

case  $1 in

start)

start

;;

stop)

stop

;;

*)

esac

exit  0

chkconfig  --add tomcat

使用chkconfig  --list tomcat可以看到已经加入自启动。使用service tomcat start或service tomcat stop可以启动或停止tomcat

重启服务器,tomcat被自动拉起。

相关文章

网友评论

      本文标题:centos6.5开机自启动脚本

      本文链接:https://www.haomeiwen.com/subject/mjbqgttx.html