LoginSignup
4
1

More than 5 years have passed since last update.

6:30JST頃に Supervisor が死んだので自動アップデートを無効にした

Last updated at Posted at 2018-05-22

本日 2018-05-22 6:30JST WebサービスのDjangoが軒並みダウンしていました。

※単純な復旧なら sudo service supervisor start

環境

16.04 LTS (Xenial Xerus)
supervisor
uwsgi
django

原因

supervisor の自動アップデートがあり、その後 supervisor が起動しなかった。
なぜ再起動しなかったかは不明。

/var/log/supervisor/supervisord.log
2018-05-22 06:26:33,504 WARN received SIGTERM indicating exit request
2018-05-22 06:26:33,574 INFO waiting for torico-blog to die
...
2018-05-22 06:26:43,599 WARN killing 'torico-blog' (16181) with SIGKILL

supervisor が、子プロセスを KILL している

/var/log/dpkg.log
2018-05-22 06:26:32 startup archives unpack
2018-05-22 06:26:33 upgrade supervisor:all 3.2.0-2ubuntu0.1 3.2.0-2ubuntu0.2
2018-05-22 06:26:33 status half-configured supervisor:all 3.2.0-2ubuntu0.1
2018-05-22 06:26:33 status unpacked supervisor:all 3.2.0-2ubuntu0.1
2018-05-22 06:26:33 status half-installed supervisor:all 3.2.0-2ubuntu0.1
...

supervisor の自動アップデートがかかったようだ。

対策

supervisor の自動アップデートはしないようにしました。

自動アップデートしているのは、Unattended-Upgrade です。アップデートするかしないかの設定は

/etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

ここにあり、Unattended-Upgrade "0"; で完全無効にできます。ただし脆弱です。

完全無効にせずとも、ブラックリストが設定できますので supervisor を追加するとよさそうです。

/etc/apt/apt.conf.d/50unattended-upgrades
// List of packages to not update (regexp are supported)
Unattended-Upgrade::Package-Blacklist {
//      "vim";
//      "libc6";
//      "libc6-dev";
//      "libc6-i686";
        "supervisor";  // ←追加
};
4
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
1