简体   繁体   English

如何停止SIGTERM和SIGKILL?

[英]How to stop SIGTERM and SIGKILL?

I need to run a huge process which will run for like 10+ minutes. 我需要运行一个巨大的过程,该过程将运行10分钟以上。 I maxed the max_execution_time , but in my error logs I get a SIGTERM and then a SIGKILL. 我最大化了max_execution_time ,但是在我的错误日志中,我得到了SIGTERM,然后得到了SIGKILL。

I read a little about SIGTERM and SIGKILL that they come from the daemon, but i Didn't figure out how to stop it from happening. 我读了一些有关SIGTERM和SIGKILL的信息,它们来自守护程序,但我不知道如何阻止它发生。 I just need to disable it for one night. 我只需要禁用一晚。

Rather than trying to ignore signals, you need to find who sends them and why. 而不是尝试忽略信号,您需要查找谁发送信号以及原因。 If you're starting php from the command line, no one will send that signal and your script time will have all the time . 如果你开始从PHP命令行,没有人会发送信号和脚本的时间将所有的时间

But if you're actually starting this process as a response to an http request, it's probably the web server of FastCGI manager that limits the amount of time it waits for the script to finish. 但是,如果您实际上是作为对http请求的响应而开始此过程的,则可能是FastCGI管理器的Web服务器限制了它等待脚本完成的时间。 It also may simply kill the script because client connection (between user's browser and http server) has been terminated. 由于客户端连接(用户浏览器和http服务器之间)已经终止,它也可能只是杀死脚本。

So the important question you should ask yourself - what's the source of that signal and how this timeout can be increased. 因此,您应该问自己一个重要的问题-该信号的来源是什么,以及如何增加超时时间。 Please also provide all details about how you start this script and what platform you're running. 还请提供有关如何启动此脚本以及所运行平台的所有详细信息。

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

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