nginx

起動スクリプト

 #!/bin/bash
 #
 # nginx        Startup script for the nginx
 #
 # chkconfig: - 85 15
 # description: nginx web server
 # processname: nginx
 # pidfile: /usr/local/nginx/logs/nginx.pid
 # config: /usr/local/nginx/conf/nginx.conf
 . /etc/rc.d/init.d/functions
 if [ -f /etc/sysconfig/nginx ]; then
     . /etc/sysconfig/nginx
 fi
 nginx=/usr/local/nginx/sbin/nginx
 prog=nginx
 pidfile=/usr/local/nginx/logs/nginx.pid
 lockfile=/var/lock/subsys/nginx
 RETVAL=0
 start() {
     echo -n $"Starting $prog: "
     daemon --pidfile=$pidfile $nginx $OPTIONS
     RETVAL=$?
     echo
     [ $RETVAL = 0 ] && touch $lockfile
     return $RETVAL
 }
 stop() {
    echo -n $"Stopping $prog: "
    $nginx -s stop
    RETVAL=$?
    echo
    [ $RETVAL = 0 ] && rm -f $lockfile $pidfile
 }
 reload() {
     echo -n $"Reloading $prog: "
     $nginx -s reload
     RETVAL=$?
     echo
 }
 case "$1" in
   start)
         start
         ;;
   stop)
         stop
         ;;
   status)
         status -p $pidfile $nginx
         RETVAL=$?
         ;;
   restart)
         stop
         start
         ;;
   reload)
         reload
         ;;
   configtest)
         $nginx -t
         RETVAL=$?
         ;;
   *)
         echo $"Usage: $prog {start|stop|restart|reload|status|configtest}"
         exit 1
 esac
 exit $RETVAL

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS