Report failed upgrades with a non-zero exit status (mintupdate-cli, mint-refresh-cache, automatic upgrades)
还没有人认领这个 Issue。
评估
调研方向
从 issue 中列出的三个入口开始: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 upgraderuns apt-get withsubprocess.call(arguments + packages, env=environment)(usr/lib/linuxmint/mintUpdate/mintupdate-cli.py, line 95 on master) and discards its return code.mint-refresh-cacheprints an error and exits 0 when the update fails or when it is run without root.system_automatic_upgrades.pyignores the result ofsubprocess.run(cmd, ...)(line 44) and always logs-- Automatic Upgrade completed(line 57), somintupdate-automation-upgrade.servicenever 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 小时
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
linuxmint/mintupdate 的其他 Issue
-
BUG
难度 2/5 1-3 小时 新手友好度 68/100
linuxmint/mintupdate#1089 · 1 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 74/100
linuxmint/mintupdate#1041 · 1 条评论 ·
-
FEATURE REQUEST
难度 1/5 1 小时以内 新手友好度 65/100
linuxmint/mintupdate#910 ·
-
难度 1/5 1 小时以内 新手友好度 65/100
linuxmint/mintupdate#903 ·
-
难度 4/5 1-2 天 新手友好度 52/100
linuxmint/mintupdate#1109 ·
查看 linuxmint/mintupdate 的全部 Issue
相似的 Issue
-
changelog investigate
难度 2/5 1-3 小时 新手友好度 67/100
ramnes/notion-sdk-py#433 ·
-
docs pkg:core
难度 1/5 1 小时以内 新手友好度 84/100
pydantic/pydantic-ai#11929 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
intake/intake-esm#789 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
MemMachine/MemMachine#1877 ·
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
openedx/openedx-authz#579 ·
维护者通常 1 天内回复