Repository navigation
A library update never restarts incusd under live terminals - #335
Merged
Merged
Conversation
…ost status survives a silent incus
…honest 143 claim HostDropIn.install(shell, target) is the one checked write; migrate used its own exec/ok/throw copy and said "not written" when the write had landed and only the reload failed. The concurrent-install test now gives up after ten seconds instead of spinning forever on a hung bash. The CHANGELOG said sail upgrade rewrites an installed sail-api unit with SuccessExitStatus=143; the upgrade's reconcile runs in the old binary, so a box gets the line from its next upgrade on, and the entry says so.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec:
sail-host-needrestart-policy.On 2026-09-18 and again on 2026-10-22, an unattended Ubuntu security update had needrestart restart
incus.servicein automatic mode. incusd kills every interactiveincus execon shutdown, so every container terminal in every project ended.What changed
NeedrestartPolicy.DROP_IN(sail-harness, besideSshdKeepalive) is/etc/needrestart/conf.d/50-sail.conf:$nrconf{override_rc}{qr(^incus)} = 0;. Both drop-ins are now oneHostDropInrecord (name, path, content, reload). It owns the one install script, which writes atomically with mode 0644 and passes the content to bash as an argument. The sshd drop-in's write becomes atomic as a result.sail migrate(so everysail upgrade) writes both drop-ins from one list, through one catch ladder. The wiring is now under test (ensureHostDropIns); before, nothing tested that migrate wrote the sshd drop-in at all.sail host initwrites the policy first in step 1, beforeapt-get upgrade, so a library that upgrade replaces does not restart incusd. An incus package upgraded by a re-run still restarts it, as any incus upgrade does; the README says so. Init fails fast if the write fails, and--dry-runprints the command.sail host updateis deleted.host status(JSON and banner, now underHostStatusCommandTest) runsincus versionlive through one parser (HostProvisioner.incusVersion), which init now shares; the copy in HostUpdateCommand went with it.HostYaml.withIncusVersionis deleted (it had no caller left).SuccessExitStatus=143.reconcile()carries it to installed boxes from their next upgrade on: the upgrade's reconcile runs in the old binary (a migrate-written unit would be reverted by it on the same hop), so the CHANGELOG says so.sudo sail host initwrites it at once.sudo sail session lsfirst. CHANGELOG entry.Takeover (943e546):
HostDropIn.install(shell, target)is the one checked write; migrate's own exec/ok/throw copy is gone, and its warning no longer says "not written" when only the reload failed. The concurrent-install test gives up after ten seconds instead of spinning on a hung bash. Independent delta review: 1 MEDIUM (the 143 claim, fixed in wording), 2 shape/robustness LOW (fixed), 1 LOW wording (fixed); no HIGH. Seven fix-reverting mutants red: init omits the policy, prerequisites omit it, the write is not atomic, a silent daemon reads as zero containers, the unit drops 143, migrate omits the policy, the regex namessail. Local-Pintegrationverify green before and after the delta.Deleted:
HostUpdateCommand(108 lines),HostYaml.withIncusVersion, a duplicateincus versionparser, the sshd drop-in's own install script and accessors (folded intoHostDropIn),host updatefromROOT_ONLY,RootRequiredTestand theLifecycleCommandTesthelp test.git diff --shortstat: 30 files changed, 729 insertions(+), 314 deletions(-).Deviation: the drop-in comment says "Restart incus on purpose, when no terminal into a container is open." instead of naming
sail session ls/sail host update. The verb is gone, andOperatorHintsTestforbidssail <verb>literals outsideOperatorCommand, which sail-harness cannot reach. EnrollCommand already saidsudo sail upgradeon main, so nothing changed there.Tests that bite (fix-reverting mutants, all killed): migrate omits the policy; init omits the policy; the unit drops 143; the banner reads
host.yaml; the regex says^sail; the status JSON readshost.yaml.