Skip to content

Commit a9c2a1f

Browse files
committed
chore: release 0.7.28
- Updated version number to 0.7.28. - Fixed critical issue in host_updater.cpp regarding the `--setenv` argument format for systemd-run to ensure proper logging during upgrades.
1 parent 561fbb5 commit a9c2a1f

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.7.27
1+
0.7.28

src/daemon/host_updater.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,21 @@ AptSpawnResult SpawnAptUpgrade(const std::string& target_version,
283283
// exec systemd-run, which moves us into a fresh transient
284284
// scope cgroup before exec-ing /bin/sh. Once we're in the new
285285
// cgroup, `systemctl restart tenboxd` can no longer reach us.
286+
//
287+
// CRITICAL: `--setenv` must be a single argv of the form
288+
// `--setenv=KEY=VALUE` (or `--setenv KEY=VALUE` as two argvs).
289+
// An earlier version split it as `--setenv=LOG` + `<path>`,
290+
// which made systemd-run treat the path as the command to
291+
// exec; the scope spun up and died in the same millisecond
292+
// ("Deactivated successfully"), the log file stayed empty,
293+
// and no upgrade ever ran. Build the env arg as one string.
294+
const std::string log_env = std::string("--setenv=LOG=") + log_path;
286295
const char* argv[] = {
287296
"systemd-run",
288297
"--scope",
289298
"--collect",
290299
"--quiet",
291-
"--setenv=LOG", log_path.c_str(),
300+
log_env.c_str(),
292301
"/bin/sh", "-c", script.c_str(),
293302
nullptr,
294303
};

0 commit comments

Comments
 (0)