Repository navigation
docs(liveswap): run as the hotserve user with runuser, not sudo -u - #366
Merged
Merged
Conversation
The box's privileged path is root over SSH, and a Debian 13 box need not have sudo installed, so the three `sudo -u hotserve …` lines end `sudo: command not found`. `runuser -u hotserve --` is in util-linux, always present; `env` carries XDG_RUNTIME_DIR, which runuser does not take as an argument the way sudo does. Each line now says "as root". The same failure class as #323.
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are reported for the updated liveswap command examples.
No open issues 🎉
What changed in this PR
Updates liveswap’s operational examples to work from a root SSH session on boxes without sudo, consistent with the guidance in #323.
Changes:
- Replaces three
sudo -u hotservecommands withrunuser -u hotserve --and clarifies that root runs them. - Uses
envfor theXDG_RUNTIME_DIRassignments and keeps each command on one source line for reliable copying.
| File | Description |
|---|---|
liveswap/README.md |
Updates health-check and unit-stop examples to use runuser rather than sudo. |
Review effort: Balanced
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.
liveswap/README.mdhad three commands that run as the hotserve user throughsudo -u hotserve …:pre_startunit that hangs;liveswapblock.The box's privileged path is root over SSH, and a Debian 13 box need not have
sudoinstalled (debian:trixiedoesn't). On such a box each line endssudo: command not found. This is the same failure class as #323, found while fixing it.Each line now uses
runuser -u hotserve --, from util-linux, which is always present, and says "as root".runuserdoes not takeVAR=valueas an argument the waysudodoes, so the twosystemctl --userlines putenvbeforeXDG_RUNTIME_DIR=…. Checked indebian:trixie:runuser -u nobody -- env XDG_RUNTIME_DIR=/run/user/$(id -u nobody) sh -c 'id -un; echo $XDG_RUNTIME_DIR'printsnobodyand/run/user/65534.Each command is now on one source line, so a copy from the raw file (
lesson the box) doesn't split$(id -u hotserve)or end atenv. Otherwise the lines keep their shape.backupcarries the same three lines, and they reach it with the next merge of main.Triage, for reviewers: a wrong command in a doc, scored S2 O5 D1 = 10, size 1, risk 2 (no test checks the text). Under the project's rule that is an accepted residual, but the owner asked for the fix. The bar for review findings is the same: a finding is fixed if it names a failure that silently breaks something, or one that holds under a single fault.
Self-review (
/code-reviewmedium), two findings not fixed:runuserkeeps root's environment wheresudoreset it, so aDBUS_SESSION_BUS_ADDRESSfrom root's session reachessystemctl --user. That changes no outcome: systemctl dials the manager's private socket under$XDG_RUNTIME_DIR/systemd/first, and falls back to the bus only when that socket is missing. Then hotserve's user manager isn't running and there is nothing to stop either way. Not scored, since no outcome changes.curlline. That's the operator's own environment, and a request that goes wrong fails loudly in curl's words. 2×5×1 = 10, size 1, risk 2: accepted.