fix(system_baseline): run the apt upgrade with TMPDIR outside /tmp and /var/tmp
An openssh-server upgrade restarts ssh.service. With PrivateTmp=yes systemd then deletes that unit's /tmp and /var/tmp, which removes the files apt staged there while the upgrade is still running, so dpkg fails and leaves packages unpacked but not configured. The update flow now creates system_baseline_apt_tmpdir (root, mode 0700), runs the upgrade and the autoremove with TMPDIR set to it, and opens a new connection afterwards. The input is validated in the main flow and in the update entry point: absolute, no "..", not under /tmp or /var/tmp. Closes #374 Assisted-by: Claude Code:claude-sonnet-5-5
This commit is contained in:
1 parent
008c5ab8a4
commit
1bbf3368ee
11 files changed
+151
-1
No files matched your search
@@ -11,6 +11,10 @@ system_baseline_reboot_throttle: 0
|
||||
system_baseline_reboot_post_delay: 0
|
||||
# Systemd time span (for example 1h) written as TimeoutStartSec of apt-daily.service; empty leaves the host alone (tasks/apt_daily_timeout.yml).
|
||||
system_baseline_apt_daily_timeout: ""
|
||||
# Directory the apt upgrade and autoremove use as TMPDIR (tasks/update.yml): absolute, never /tmp or /var/tmp. An openssh-server upgrade
|
||||
# restarts ssh.service, and with PrivateTmp=yes systemd then deletes that unit's /tmp and /var/tmp while the upgrade still needs its staged files.
|
||||
# Created root-owned, mode 0700.
|
||||
system_baseline_apt_tmpdir: /var/cache/system-baseline-apt-tmp
|
||||
# Run the package update (tasks/update.yml) in the main flow. false skips it, for hosts that are patched by a separate,
|
||||
# operator-run flow; the tasks_from: update entry point does not read it.
|
||||
system_baseline_update: true
|
||||
|
||||
Reference in new issue
Block a user