szhswl
          宋針還的個人空間
            1 #!/bin/bash 
            2 
            3 # httpd        Startup script for the Apache HTTP Server 
            4 
            5 # chkconfig: - 85 15 
            6 # description: Apache is a World Wide Web server.  It is used to serve \ 
            7 #              HTML files and CGI. 
            8 # processname: httpd 
            9 # config: /etc/httpd/conf/httpd.conf 
           10 # config: /etc/sysconfig/httpd 
           11 # pidfile: /var/run/httpd.pid 
           12 
           13 # Source function library. 
           14 . /etc/rc.d/init.d/functions 
           15 
           16 if [ -/etc/sysconfig/httpd ]; then 
           17         . /etc/sysconfig/httpd 
           18 fi 
           19 
           20 # Start httpd in the C locale by default. 
           21 HTTPD_LANG=${HTTPD_LANG-"C"
           22 
           23 # This will prevent initlog from swallowing up a pass-phrase prompt if 
           24 # mod_ssl needs a pass-phrase from the user. 
           25 INITLOG_ARGS="" 
           26 
           27 # Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server 
           28 # with the thread-based "worker" MPM; BE WARNED that some modules may not 
           29 # work correctly with a thread-based MPM; notably PHP will refuse to start. 
           30 
           31 # Path to the apachectl script, server binary, and short-form for messages. 
           32 apachectl=/usr/local/apache2/bin/apachectl 
           33 httpd=${HTTPD-/usr/local/apache2/bin/httpd} 
           34 prog=httpd 
           35 pidfile=${PIDFILE-/var/run/httpd.pid} 
           36 lockfile=${LOCKFILE-/var/lock/subsys/httpd} 
           37 RETVAL=0 
           38 
           39 # check for 1.3 configuration 
           40 check13 () { 
           41         CONFFILE=/usr/local/apache2/conf/httpd.conf 
           42         GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|" 
           43         GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|" 
           44         GONE="${GONE}AccessConfig|ResourceConfig)" 
           45         if LANG=grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then 
           46                 echo 
           47                 echo 1>&2 " Apache 1.3 configuration directives found" 
           48                 echo 1>&2 " please read /usr/share/doc/httpd-2.0.52/migration.html" 
           49                 failure "Apache 1.3 config directives test" 
           50                 echo 
           51                 exit 1 
           52         fi 
           53 
           54 
           55 # The semantics of these two functions differ from the way apachectl does 
           56 # things -- attempting to start while running is a failure, and shutdown 
           57 # when not running is also a failure.  So we just do it the way init scripts 
           58 # are expected to behave here. 
           59 start() { 
           60         echo -n $"Starting $prog: " 
           61         check13 || exit 1 
           62         LANG=$HTTPD_LANG daemon $httpd $OPTIONS 
           63         RETVAL=$? 
           64         echo 
           65         [ $RETVAL = 0 ] && touch ${lockfile} 
           66         return $RETVAL 
           67 
           68 stop() { 
           69         echo -n $"Stopping $prog: " 
           70         killproc $httpd 
           71         RETVAL=$? 
           72         echo 
           73         [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile} 
           74 
           75 reload() { 
           76     echo -n $"Reloading $prog: " 
           77     if ! LANG=$HTTPD_LANG $httpd $OPTIONS ->&/dev/null; then 
           78         RETVAL=$? 
           79         echo $"not reloading due to configuration syntax error" 
           80         failure $"not reloading $httpd due to configuration syntax error" 
           81     else 
           82         killproc $httpd -HUP 
           83         RETVAL=$? 
           84     fi 
           85     echo 
           86 
           87 
           88 # See how we were called. 
           89 case "$1" in 
           90   start) 
           91         start 
           92         ;; 
           93   stop) 
           94         stop 
           95         ;; 
           96   status) 
           97         status $httpd 
           98         RETVAL=$? 
           99         ;; 
          100   restart) 
          101         stop 
          102         start 
          103         ;; 
          104   condrestart) 
          105         if [ -f ${pidfile} ] ; then 
          106                 stop 
          107                 start 
          108         fi 
          109         ;; 
          110   reload) 
          111         reload 
          112         ;; 
          113   graceful|help|configtest|fullstatus) 
          114         $apachectl $@ 
          115         RETVAL=$? 
          116         ;; 
          117   *
          118         echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}" 
          119         exit 1 
          120 esac 
          121 
          122 exit $RETVAL


          ---------------------------------------------------------------------------------------------------------------------------------
          說人之短,乃護己之短。夸己之長,乃忌人之長。皆由存心不厚,識量太狹耳。能去此弊,可以進德,可以遠怨。
          http://www.aygfsteel.com/szhswl
          ------------------------------------------------------------------------------------------------------ ----------------- ---------
          posted on 2007-12-12 21:58 宋針還 閱讀(693) 評論(0)  編輯  收藏 所屬分類: 操作系統
          主站蜘蛛池模板: 蒙山县| 凤阳县| 甘肃省| 阿克陶县| 白朗县| 抚宁县| 秀山| 威远县| 合川市| 大英县| 弋阳县| 安平县| 阿拉善右旗| 贵阳市| 砀山县| 六盘水市| 颍上县| 井研县| 祥云县| 芦溪县| 定日县| 伊通| 铜陵市| 苍溪县| 平安县| 南涧| 灌云县| 北碚区| 平远县| 金昌市| 巴楚县| 西城区| 赤城县| 泗阳县| 丰宁| 仲巴县| 江永县| 呼和浩特市| 监利县| 香港| 本溪|