Stretchでnginxをアップグレード中にエラーが発生しました。

Stretchでnginxをアップグレード中にエラーが発生しました。

最後のDebian Stretchルーティングセキュリティの更新中に問題が発生しました。セキュリティアップグレードをインストールした後にアップグレードしようとすると、nginx次のエラーが発生します。

apt-get upgradeもう一度実行してみるか、apt-get install関連パッケージを試してみましたが、何も機能しないようです。

何をすべきか?

$ apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
6 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] 
Setting up libnginx-mod-stream (1.10.2-2) ...
nginx: [alert] kill(1433, 1) failed (3: No such process)
dpkg: error processing package libnginx-mod-stream (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up libnginx-mod-http-echo (1.10.2-2) ...
nginx: [alert] kill(1433, 1) failed (3: No such process)
dpkg: error processing package libnginx-mod-http-echo (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx-full:
 nginx-full depends on libnginx-mod-http-echo (= 1.10.2-2); however:
  Package libnginx-mod-http-echo is not configured yet.
 nginx-full depends on libnginx-mod-stream (= 1.10.2-2); however:
  Package libnginx-mod-stream is not configured yet.

dpkg: error processing package nginx-full (--configure):
 dependency problems - leaving unconfigured
Setting up libnginx-mod-http-upstream-fair (1.10.2-2) ...
nginx: [alert] kill(1433, 1) failed (3: No such process)
dpkg: error processing package libnginx-mod-http-upstream-fair (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up libnginx-mod-http-geoip (1.10.2-2) ...
nginx: [alert] kill(1433, 1) failed (3: No such process)
dpkg: error processing package libnginx-mod-http-geoip (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of nginx:
 nginx depends on nginx-full (<< 1.10.2-2.1~) | nginx-light (<< 1.10.2-2.1~) | nginx-extras (<< 1.10.2-2.1~); however:
  Package nginx-full is not configured yet.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.
 nginx depends on nginx-full (>= 1.10.2-2) | nginx-light (>= 1.10.2-2) | nginx-extras (>= 1.10.2-2); however:
  Package nginx-full is not configured yet.
  Package nginx-light is not installed.
  Package nginx-extras is not installed.

dpkg: error processing package nginx (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libnginx-mod-stream
 libnginx-mod-http-echo
 nginx-full
 libnginx-mod-http-upstream-fair
 libnginx-mod-http-geoip
 nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

ベストアンサー1

最後に、問題を分析し、インストール後のスクリプトを見て、問題を特定しました。これらのnginxコンポーネントをインストール/アップグレードする場合は、各パッケージに対して再起動を試み、操作が成功したことを確認nginxしてください。

したがって、更新タスクでは、メンテナンスセキュリティの更新/アップグレードサイクルを実行する前に停止を開始してから実行されないようにするmonit必要があります。nginxapt-get upgrade

修正は順番に行われました。

  • 停止しますmonit
  • (p)kill -9nginxプロセスの説明
  • 何かを作るservice start nginx
  • 最後にやり直してくださいapt-get upgrade
  • いよいよアップグレードが正常に終了しますservice monit start

monit今回は邪魔にならず、upgrade効果がありました。

最終的に学んだ教訓は、標準的なアップグレード手順を修正し、monitセキュリティ更新プロセスの前にAnsible Playbookを停止するか、理想的に一時停止するように変更することでした。

おすすめ記事