Supervisor 出于某种原因获得 SIGTERM,退出并停止其所有进程
Supervisor gets a SIGTERM for some reason, quits and stops all its processes
我在 Ubuntu 12.04 机器(安装了 pip
)上使用 supervisor 来 运行 gunicorn 和 Django。
我开始 supervisord
一切都很好。我可以通过代理 gunicorn 的 nginx 服务器访问我的 Django 应用程序。问题是,几个小时甚至一天后,主管就停止了。主管日志显示 WARN received SIGTERM indicating exit request
,以下几行是 'supervised' 个进程的关闭。
我不太确定发生了什么以及发送 SIGTERM 的原因。我搜索了Google,发现有人有类似的问题,并在GitHub开了一个issue,但他关闭了,他的解决方案与我的设置无关:https://github.com/Supervisor/supervisor/issues/321
我进一步阅读了关于发送 SIGTERM 的内存不足问题,但我的服务器 运行 资源不高并且有足够的可用内存。
如何更好地调试此问题?
问题下的评论绝对是一个很好的答案:
Check /var/log/apt/history.log (ubuntu). I found out there was unattended-upgrade of supervisor.
在我的例子中,我检查了 /var/log/supervisor/supervisord.log
中的 SIGTERM
和 /var/log/apt/history.log
中的 Start-Date
的时间戳。它们确实是同一时间,这几乎证实了自动更新是这里的问题所在。
要关闭它们,就像在 this tutorial 中一样,您可以修改 /etc/apt/apt.conf.d/10periodic
使其具有以下值:
APT::Periodic::Update-Package-Lists "0";
我在 Ubuntu 12.04 机器(安装了 pip
)上使用 supervisor 来 运行 gunicorn 和 Django。
我开始 supervisord
一切都很好。我可以通过代理 gunicorn 的 nginx 服务器访问我的 Django 应用程序。问题是,几个小时甚至一天后,主管就停止了。主管日志显示 WARN received SIGTERM indicating exit request
,以下几行是 'supervised' 个进程的关闭。
我不太确定发生了什么以及发送 SIGTERM 的原因。我搜索了Google,发现有人有类似的问题,并在GitHub开了一个issue,但他关闭了,他的解决方案与我的设置无关:https://github.com/Supervisor/supervisor/issues/321
我进一步阅读了关于发送 SIGTERM 的内存不足问题,但我的服务器 运行 资源不高并且有足够的可用内存。
如何更好地调试此问题?
问题下的评论绝对是一个很好的答案:
Check /var/log/apt/history.log (ubuntu). I found out there was unattended-upgrade of supervisor.
在我的例子中,我检查了 /var/log/supervisor/supervisord.log
中的 SIGTERM
和 /var/log/apt/history.log
中的 Start-Date
的时间戳。它们确实是同一时间,这几乎证实了自动更新是这里的问题所在。
要关闭它们,就像在 this tutorial 中一样,您可以修改 /etc/apt/apt.conf.d/10periodic
使其具有以下值:
APT::Periodic::Update-Package-Lists "0";