码迷,mamicode.com
首页 > Web开发 > 详细

http2.4 的启动脚本

时间:2014-10-19 07:56:18      阅读:226      评论:0      收藏:0      [点我收藏+]

标签:des   http   io   ar   sp   on   art   cti   amp   

#!/bin/bash

# httpd starts/stop the at daemon

#chkconfig: 345 61 29
#description: runs apache as httpd

#Source function library
. /etc/init.d/functions

exec=/usr/local/apache2/bin/httpd
prog="httpd"

config=/usr/local/apache2/conf/httpd.conf

lockfile=/var/lock/subsys/$prog

start()
{
[ -x $exec ] || exit 5
[ -f $config ] || exit 6
[ -f $lockfile ] && echo "http have running...." && exit 7
echo -n $"Starting $prog ....... "
sleep 1
$exec -k start
[ $? -eq 0 ] && touch $lockfile && echo -e " \033[31m OK \033[0m" || echo -e "\033[31m Failure \033[0m"

}


stop()
{
echo -n "httpd is stoping......."
sleep 1
killproc $prog > /dev/null && rm -f $lockfile && echo -e " \033[31m OK \033[0m " || echo -e "\033[31m Faiure stop \033[0m "

}


restart()
{
stop
start

}

status()

{
[ -f $lockfile ] && echo "httpd is running........" || echo "httpd have stoping......."
}


case "$1" in
start)
start;;
stop)
stop;;
restart)
restart;;
status)
status;;
*)
echo "Usage ./httpd {start|stop|restart|status}"
;;
esac

 

http2.4 的启动脚本

标签:des   http   io   ar   sp   on   art   cti   amp   

原文地址:http://www.cnblogs.com/xiaoxiaoguixia/p/4034197.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!