jojo's blog--快樂憂傷都與你同在
          為夢(mèng)想而來,為自由而生。 性情若水,風(fēng)起水興,風(fēng)息水止,故時(shí)而激蕩,時(shí)又清平……
          posts - 11,  comments - 30,  trackbacks - 0
          #!/bin/bash
          #
          # httpd        Startup script for the Apache HTTP Server
          #
          # chkconfig: 345 85 15
          # description: Apache is a World Wide Web server.  It is used to serve "
          #              HTML files and CGI.
          # processname: httpd
          # config: /usr/local/site/apache/conf/httpd.conf
          # config: /etc/sysconfig/httpd
          # pidfile: /usr/local/site/apache/logs/httpd.pid

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

          if [ -f /etc/sysconfig/httpd ]; then
                  . /etc/sysconfig/httpd
          fi

          # Start httpd in the C locale by default.
          HTTPD_LANG=${HTTPD_LANG-"C"}

          # This will prevent initlog from swallowing up a pass-phrase prompt if
          # mod_ssl needs a pass-phrase from the user.
          INITLOG_ARGS=""

          # Set HTTPD=/usr/sbin/httpd.worker in /etc/sysconfig/httpd to use a server
          # with the thread-based "worker" MPM; BE WARNED that some modules may not
          # work correctly with a thread-based MPM; notably PHP will refuse to start.

          # Path to the apachectl script, server binary, and short-form for messages.
          apachectl=/usr/sbin/apachectl
          httpd=${HTTPD-/usr/local/site/apache/bin/httpd}
          prog=httpd
          pidfile=${PIDFILE-/usr/local/site/apache/logs/httpd.pid}
          lockfile=${LOCKFILE-/var/lock/subsys/httpd}
          RETVAL=0

          # check for 1.3 configuration
          check13 () {
                  CONFFILE=/usr/local/site/apache/conf/httpd.conf
                  GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
                  GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
                  GONE="${GONE}AccessConfig|ResourceConfig)"
                  if LANG=C grep -Eiq "^[[:space:]]*($GONE)" $CONFFILE; then
                          echo
                          echo 1>&2 " Apache 1.3 configuration directives found"
                          echo 1>&2 " please read /usr/share/doc/httpd-2.2.3/migration.html"
                          failure "Apache 1.3 config directives test"
                          echo
                          exit 1
                  fi
          }

          # The semantics of these two functions differ from the way apachectl does
          # things -- attempting to start while running is a failure, and shutdown
          # when not running is also a failure.  So we just do it the way init scripts
          # are expected to behave here.
          start() {
                  echo -n $"Starting $prog: "
                  check13 || exit 1
                  LANG=$HTTPD_LANG daemon $httpd $OPTIONS
                  RETVAL=$?
                  echo
                  [ $RETVAL = 0 ] && touch ${lockfile}
                  return $RETVAL
          }

          # When stopping httpd a delay of >10 second is required before SIGKILLing the
          # httpd parent; this gives enough time for the httpd parent to SIGKILL any
          # errant children.
          stop() {
                  echo -n $"Stopping $prog: "
                  killproc -d 10 $httpd
                  RETVAL=$?
                  echo
                  [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
          }
          reload() {
              echo -n $"Reloading $prog: "
              if ! LANG=$HTTPD_LANG $httpd $OPTIONS -t >&/dev/null; then
                  RETVAL=$?
                  echo $"not reloading due to configuration syntax error"
                  failure $"not reloading $httpd due to configuration syntax error"
              else
                  killproc $httpd -HUP
                  RETVAL=$?
              fi
              echo
          }

          # See how we were called.
          case "$1" in
            start)
                  start
                  ;;
            stop)
                  stop
                  ;;
            status)
                  status $httpd
                  RETVAL=$?
                  ;;
            restart)
                  stop
                  start
                  ;;
            condrestart)
                  if [ -f ${pidfile} ] ; then
                          stop
                          start
                  fi
                  ;;
            reload)
                  reload
                  ;;
            graceful|help|configtest|fullstatus)
                  $apachectl $@
                  RETVAL=$?
                  ;;
            *)
                  echo $"Usage: $prog {start|stop|restart|condrestart|reload|status|fullstatus|graceful|help|configtest}"
                  exit 1
          esac

          exit $RETVAL

          posted on 2009-06-16 09:31 Blog of JoJo 閱讀(304) 評(píng)論(0)  編輯  收藏 所屬分類: 每日一記My Script

          <2025年6月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345

          常用鏈接

          留言簿(6)

          隨筆檔案

          文章分類

          文章檔案

          新聞分類

          新聞檔案

          相冊(cè)

          收藏夾

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 循化| 博客| 桦川县| 伊通| 张掖市| 比如县| 汤原县| 牟定县| 七台河市| 澄江县| 偏关县| 女性| 通辽市| 渭南市| 平山县| 长治市| 孝昌县| 西充县| 惠水县| 大庆市| 永清县| 水富县| 兴海县| 获嘉县| 宿松县| 和平区| 湄潭县| 金华市| 屯门区| 黄梅县| 盘锦市| 陆川县| 林口县| 东源县| 阿拉善右旗| 买车| 罗源县| 罗田县| 大新县| 简阳市| 石嘴山市|