apacheu源碼安裝,手寫的啓動腳本 ,restart 有問題,請多指教

235049275.png

235051968.png



如下是腳本程序


#chkconfig: 35 85 15

#description: Apache is a World Wide Web Server

start(){

/usr/local/httpd/bin/apachectl start

echo "httpd server start"

touch /tmp/apached.txt

}

stop(){

/usr/local/httpd/bin/apachectl stop

echo "httpd server is stoped"

rm -rf /tmp/apached.txt

}

restart(){

if [ -e /tmp/apached ];then

# killall -9 /usr/local/httpd/bin/httpd

stop

killall -9 /usr/local/httpd/bin/httpd

start

else

echo "httpd server is stopd"

start

fi

}

status(){

if [ -e /tmp/apached.txt ];then

echo "httpd server is running"

else

echo "http server is stopd"

fi

}

#read -p "/etc/init.d/apached" type

case "$1" in

"start")

start ;;

"stop")

stop ;;

"status")

status ;;

"restart")

restart ;;

*)

echo "/etc/init.d/apached options: stop|start|status|restart"

esac


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章