首页 > 系统服务 > 详细

用shell编写启动脚本模板

时间:2017-03-06 15:19:41      阅读:217      评论:0      收藏:0      [点我收藏+]
#!/bin/bash 
# The next lines are for chkconfig on RedHat systems.
# chkconfig: 35 98 02
# description: Starts and stops xxx Server 
 
# The next lines are for chkconfig on SuSE systems.
# /etc/init.d/xxx
#
### BEGIN INIT INFO
# Provides: xxx
# Required-Start: $network $syslog
# Required-Stop:
# Default-Start: 2 3 5
# Default-Stop: 0 6
# Short-Description: Starts and stops xxx Server 
# Description: Starts and stops xxx Server 
### END INIT INFO
 
case $1 in 
   start)  # 服务启动需要做的步骤
           ...
           ;;
   stop)  # 服务停止需要做的步骤
           ...
           ;;
   restart) # 重启服务需要做的步骤
            ...
            ;;
   status) # 查看状态需要做的步骤
             ...
             ;;
   *) echo "$0 {start|stop|restart|status}"
             exit 4
             ;;
esac

http://refspecs.linux-foundation.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html




本文出自 “禅剑一如” 博客,请务必保留此出处http://yanconggod.blog.51cto.com/1351649/1903548

用shell编写启动脚本模板

原文:http://yanconggod.blog.51cto.com/1351649/1903548

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!