FastCGI的清理code没有窗户下工作 [英] FastCGI cleanup code does not work under windows

查看:122
本文介绍了FastCGI的清理code没有窗户下工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Apache的mod_fastcgi与Windows服务器上的C code看起来像:

Using apache on a windows server with mod_fastcgi, the C code looks like that:

void main() {
    init();
    while (FCGI_Accept() >= 0)
        work();
    cleanup();
}

当服务被取下来(即:净停止的Apache2),过程终止,而无法清除code。

When the service is taken down (i.e.: net stop apache2), the process terminates without getting to the cleanup code.

我是什么在这里失踪?

推荐答案

看来,从读 FCGI_Accept将手册页和的此FAQ条目 FCGI_Accept将不,在事实上,返回-1在Apache中的情况下关闭。尝试设置为SIGUSR1和SIGTERM信号处理程序。这里有一个例子(没有特定于Windows,但它是值得一试)公布前一阵子的一个邮件列表,这里

It seems, from reading the FCGI_Accept manpage and this FAQ entry that FCGI_Accept does not, in fact, return -1 in the case of Apache shutting down. Try setting a signal handler for SIGUSR1 and SIGTERM. There's an example (not Windows-specific, but it's worth a try) posted a while ago on a mailing list, here.

这篇关于FastCGI的清理code没有窗户下工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆