Onboard: auto-enable systemd lingering on Linux

This commit is contained in:
Tobias Bischoff authored and Peter Steinberger committed 2026-01-05 21:20:05 +00:00
1 parent 949ea38ef5
commit de153a40d0
4 files changed
+42 -12

No files matched your search

+11 -2
View File
@@ -42,8 +42,8 @@ export async function ensureSystemdUserLingerInteractive(params: {
params.reason ??
"Systemd user services stop when you log out or go idle, which kills the Gateway.";
const actionNote = params.requireConfirm
? "We can enable lingering now (needs sudo; writes /var/lib/systemd/linger)."
: "Enabling lingering now (needs sudo; writes /var/lib/systemd/linger).";
? "We can enable lingering now (may require sudo; writes /var/lib/systemd/linger)."
: "Enabling lingering now (may require sudo; writes /var/lib/systemd/linger).";
await prompter.note(`${reason}\n${actionNote}`, title);
if (params.requireConfirm && prompter.confirm) {
@@ -60,6 +60,15 @@ export async function ensureSystemdUserLingerInteractive(params: {
}
}
const resultNoSudo = await enableSystemdUserLinger({
env,
user: status.user,
});
if (resultNoSudo.ok) {
await prompter.note(`Enabled systemd lingering for ${status.user}.`, title);
return;
}
const result = await enableSystemdUserLinger({
env,
user: status.user,