fastcgi init script on centos

分类:Ruby 2009-03-20 来源:CodeWeblog.com 人气:448
#!/bin/bash
#
# fcgi     Startup script for fcgi
#
# processname: fcgi

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

FCGI_DAEMON="/usr/local/bin/spawn-fcgi"
FCGI_PROGRAM="/usr/local/bin/php-cgi"
FCGI_SOCKET="/tmp/php-fastcgi.sock"
FCGI_PIDFILE="/var/run/spawn-fcgi.pid"
PHP_FCGI_CHILDREN=4
PHP_FCGI_MAX_REQUESTS=1000
prog="fcgi" 

export PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS

RETVAL=0

start() {
        echo -n $"Starting $prog: "
        daemon $FCGI_DAEMON -f $FCGI_PROGRAM -s $FCGI_SOCKET -C $PHP_FCGI_CHILDREN -P $FCGI_PIDFILE
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog
        return $RETVAL
}

stop() {
        echo -n $"Stopping $prog: "
        rm -f $FCGI_PIDFILE $FCGI_SOCKET
        killproc $FCGI_PROGRAM
        RETVAL=$?
        echo
        [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
        return $RETVAL
}

case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        restart)
                stop
                start
                ;;
        condrestart)
                if [ -f /var/lock/subsys/$prog ]; then
                        stop
                        start
                fi
                ;;
        status)
                status $lighttpd
                RETVAL=$?
                ;;
        *)
                echo $"Usage: $0 {start|stop|restart|condrestart|status}"
                RETVAL=1
esac

exit $RETVAL
分享到:
blog comments powered by Disqus

相关文章

  • Instiki Redhat Init Script 2010-07-18

    Here is a simple Redhat Linux-compatible (chkconfig) script that you can use to start and stop instiki, and also to make it startup when your system boots (chkconfig - add instiki). Copy this and put it into a file called: / etc / init.d / instiki #!

  • jQuery source code analysis-extend function 2010-07-16

    Prepared to jQuery, Ext, etc. Source careful analysis of the framework again, and the results sent to for all to study and discussions. This is my virgin posted, also please be lenient. /*! * jQuery源码分析-extend函数 * jQuery版本:1.4.2 * * -----------------

  • jQuery source code analysis-each function 2010-07-20

    /*! * jQuery源码分析-each函数 * jQuery版本:1.4.2 * * ---------------------------------------------------------- * 函数介绍 * * each函数通过jQuery.extend函数附加到jQuery对象中: * jQuery.extend({ * each: function() {} * }); * 如果对jQuery.extend函数源码还不了解,可以参考《jQuery源码分析-extend函数》

  • [Reprinted] wordpress source code analysis the_meta function and get_post_meta function 2010-09-21

    http://www.hzynh.cn/html/wordpress-source-code-analysis-the_meta-function-and-get_post_meta-function.html In this wordpress source code analysis, I will introduce the_meta function and get_post_meta function. Many times you apart from the default wor

  • understanding of anonymous function javascript, js function included in parentheses as (function (){}) 2010-09-03

    Code: (Function () ( / / Here to ignore all the realization of jQuery })(); (Function () (/ / here ignore all realize })(); jQuery Six months ago, when the initial contact with jQuery, I like everyone else is excited to see what kind of source. Howev

  • C language memory allocation: malloc () function and alloc () function 2010-07-19

    This article describes the C language, malloc () function and alloc () function. C language with the memory allocation method (1) from the static storage area field distribution. Memory when the program has compiled a good distribution of this piece

  • C language: malloc () function and alloc () function 2010-07-24

    C language with the memory allocation method (1) allocation from the static storage area. Memory when the program has compiled a good distribution, this memory during the entire operation in the program are present. For example, global variables, sta

  • Virtual function / pure virtual function 2010-08-31

    1. First of all: to emphasize a concept of virtual function to define a function, does not mean that function is not implemented function. He defined virtual function is to allow the use of the base class pointer to call the sub-class of this functio

  • About C + + on the function returns the function return value in the Detailed passed by reference 2010-10-16

    About C + + on the function returns the function return value in the Detailed passed by reference In jars to see this issue, do come out to say, we want to help. This paper explains the C + +, on the function returns the function return value in the

  • Linux, the number of subdirectories in the source code to the CVS repository Bash script 2010-10-23

    Linux, the number of subdirectories in the source code to the CVS repository Bash script This link: http://codingstandards.javaeye.com/blog/792113 (reprint, please indicate the source) Asked to describe In the src directory contains multiple subdirec

iOS 开发

Android 开发

Python 开发

JAVA 开发

开发语言

PHP 开发

Ruby 开发

搜索

前端开发

数据库

开发工具

开放平台

Javascript 开发

.NET 开发

云计算

服务器

Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.153 (s). 12 q(s)