Commit 67301fd
fix(linux): host updates fail installing unit files via /dev/stdin (#64)
The first live 1Helm host update (0.0.39 -> 0.0.40) failed and rolled back.
The cause was not the health check (the server was coming up fine) but an
earlier step: install-linux-units.sh writes four files - the tmpfiles.d
config and the three systemd units - with
install -m 0644 /dev/stdin DEST <<EOF ... EOF
That reopens fd 0 through /proc. It works when the script runs from an
operator shell (every fresh install), but fails with "install: No such
file or directory" when the script runs inside a systemd-run oneshot -
which is exactly and only how the UPDATE path invokes it. So every fresh
install succeeded and the first update could never have succeeded. Under
set -e the ENOENT aborted the apply transaction, which correctly rolled
back to the prior healthy release.
Each heredoc is now captured to a temp file and installed from there via a
small install_stdin helper - robust in every execution context, and the
literal unit contents and mode are unchanged.
Adds a regression guard that fails if any command line in
install-linux-units.sh installs from /dev/stdin again. Verified non-vacuous:
reintroducing the pattern fails the test with this message.
Because apply-linux-release.sh runs the TARGET release's copy of this
script, the fix only takes effect once shipped, so it must go out in the
next release for updates to that release to succeed.
Co-authored-by: Joseph Yaksich <gitcommit90@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent c2690ba commit 67301fd
2 files changed
Lines changed: 22 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
36 | 48 | | |
37 | 49 | | |
38 | 50 | | |
39 | 51 | | |
40 | 52 | | |
41 | 53 | | |
42 | 54 | | |
43 | | - | |
| 55 | + | |
44 | 56 | | |
45 | 57 | | |
46 | 58 | | |
| |||
50 | 62 | | |
51 | 63 | | |
52 | 64 | | |
53 | | - | |
| 65 | + | |
54 | 66 | | |
55 | 67 | | |
56 | 68 | | |
| |||
93 | 105 | | |
94 | 106 | | |
95 | 107 | | |
96 | | - | |
| 108 | + | |
97 | 109 | | |
98 | 110 | | |
99 | 111 | | |
| |||
112 | 124 | | |
113 | 125 | | |
114 | 126 | | |
115 | | - | |
| 127 | + | |
116 | 128 | | |
117 | 129 | | |
118 | 130 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
277 | 283 | | |
278 | 284 | | |
279 | 285 | | |
| |||
0 commit comments