Search code examples
ubuntusupervisord

Supervisor gets a SIGTERM for some reason, quits and stops all its processes


I use supervisor on an Ubuntu 12.04 machine (installed with pip) to run gunicorn and Django.

I start supervisord and everything is fine. I can reach my Django app through the nginx server which proxies gunicorn. The problem is, that after a few hours or even a day, supervisor stops. The supervisor log shows WARN received SIGTERM indicating exit request and the lines following are the shutting down of the 'supervised' processes.

I'm not really sure what is going on and what sends the SIGTERM. I searched Google and found someone who had a similar problem and opened an issue in GitHub, but he closed it, and his solution was not related to my setup: https://github.com/Supervisor/supervisor/issues/321

I read a bit further about an our-of-memory issue sending a SIGTERM, but my server does not run high on resources and has plenty of free memory.

What can I do to debug this issue better?


Solution

  • The comment under the question is definitely a good answer:

    Check /var/log/apt/history.log (ubuntu). I found out there was unattended-upgrade of supervisor.

    In my case, I checked the timestamps of the SIGTERM in /var/log/supervisor/supervisord.log and Start-Date in /var/log/apt/history.log. They were indeed the same time, which all but confirms the fact that auto updates were the problem here.

    To turn those off, like in this tutorial, you can modify /etc/apt/apt.conf.d/10periodic to have the value:

    APT::Periodic::Update-Package-Lists "0";