http2.4 的启动脚本

#!/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

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。