繁体   English   中英

后端在系统启动时关闭

[英]Backend shuts down on system startup

我在lighttpd(fastcgi)上使用python。 当我使用/etc/init.d/lighttpd start启动服务器时,一切正常。

但是现在我已经将它添加到system-v init中,其中update-rc.d lighttpd defaults 60值为update-rc.d lighttpd defaults 60 ,重新启动后,我在错误日志中显示了以下内容:

2011-03-24 22:57:01: (log.c.164) server started
2011-03-24 22:57:42: (mod_fastcgi.c.1754) connect failed: Connection refused on unix:/tmp/dvr.sock-0
2011-03-24 22:57:42: (mod_fastcgi.c.3021) backend died; we'll disable it for 1 seconds and send the request to another backend instead: reconnects: 0 load: 1
2011-03-24 22:57:55: (mod_fastcgi.c.2562) unexpected end-of-file (perhaps the fastcgi process died): pid: 1509 socket: unix:/tmp/dvr.sock-0
2011-03-24 22:57:55: (mod_fastcgi.c.3299) child exited, pid: 1509 status: 1
2011-03-24 22:57:55: (mod_fastcgi.c.3346) response not received, request sent: 858 on socket: unix:/tmp/dvr.sock-0 for /dvr.fcgi?, closing connection

/etc/init.d/lighttpd restart它开始正常工作。

我忘了说我使用环境变量为我的烧瓶项目选择设置文件。 当然,此变量是在/etc/profile中设置的,这就是为什么我能够从shell正确启动项目的原因。

因此,在我的情况下,我必须使用bin-environment选项将此变量传递给lighttpd,以使其可用于fcgi脚本:

fastcgi.server = (
    "/dvr.fcgi" => (
        "main" => (
            "socket" => "/tmp/dvr.sock",
            "bin-path" => "/var/www/dvr/conf/lighttpd/dvr.fcgi",
            "bin-environment" => (
                    "DVR_SETTINGS" => "/var/www/dvr/settings/production.py"
            ),
            "check-local" => "disable",
            "max-procs" => 1,
        )
    ),
)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM