Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Report failed upgrades with a non-zero exit status (mintupdate-cli, mint-refresh-cache, automatic upgrades)

オープン 初心者向け
#1,107 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
linux, python
領域
cli, devops

調査の方向性

issue に記載された 3 つのエントリーポイントから始めます。usr/lib/linuxmint/mintUpdate/mintupdate-cli.py、mint-refresh-cache、system_automatic_upgrades.py それぞれについて、サブプロセスの結果とエラー分岐の処理を追います。次に、これらのコマンドを対象とする既存のテストがあるか確認します。失敗時にゼロ以外のステータスを返し、自動アップグレードが失敗をログに記録し、成功時は現在の動作を維持すれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Is your feature request related to a problem? Please describe.

When an upgrade or a cache refresh fails, every entry point still reports success, so the failure is invisible to anything that checks exit codes: cron, Ansible, scripts, systemctl --failed or fleet monitoring.

  • mintupdate-cli upgrade runs apt-get with subprocess.call(arguments + packages, env=environment) (usr/lib/linuxmint/mintUpdate/mintupdate-cli.py, line 95 on master) and discards its return code.
  • mint-refresh-cache prints an error and exits 0 when the update fails or when it is run without root.
  • system_automatic_upgrades.py ignores the result of subprocess.run(cmd, ...) (line 44) and always logs -- Automatic Upgrade completed (line 57), so mintupdate-automation-upgrade.service never fails.

Reproduced on Linux Mint 22.2 with mintupdate 7.1.1, using a fake apt-get on PATH that exits 100:

$ PATH=/tmp/fakebin:$PATH mintupdate-cli upgrade --dry-run; echo $?
E: Could not get lock /var/lib/dpkg/lock-frontend (simulated)
0
$ mint-refresh-cache; echo $?
Error: mint-refresh-cache requires admin privileges
0

Related: #1097 (a failed scheduled cache refresh goes unnoticed) and #1043 (automatic updates silently not installing).

Describe the solution you'd like

Propagate the failure:

  • mintupdate-cli: sys.exit(subprocess.call(...)) so apt-get's status is returned.
  • mint-refresh-cache: sys.exit(1) in the error branches.
  • system_automatic_upgrades.py: check the return code, log -- Automatic Upgrade failed (exit N) and exit non-zero so the systemd unit is marked failed.

Successful runs behave exactly as today.

Describe alternatives you've considered

Parsing the log in /var/log/mintupdate.log, which is fragile and only works on machines someone is watching.

Additional context

Happy to send a pull request if this direction is acceptable.

主要言語
Python
スター
424
フォーク
191
平均マージ
23日 14時間
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

linuxmint/mintupdate のほかの issue

linuxmint/mintupdate の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。