Skip to content

scxtui: Say on the Configured line whether the unit starts at boot - #3973

Merged
sirlucjan merged 2 commits into
mainfrom
scxcli-fixes
Nov 10, 2026
Merged

sirlucjan merged 2 commits into
mainfrom
scxcli-fixes

Conversation

@sirlucjan

Copy link
Copy Markdown
Collaborator

The first question after switching schedulers is whether the choice survives a reboot. The answer is in the listing already, as unit.enabled, and neither scxtui's panel nor scxcli get said it: a user had to know that start ID runs systemctl enable and that start default disables the unit, or go and ask systemctl. The first tester to try scxtui worked it out in a couple of seconds and then asked for it to be on screen.

Put it on the Configured line, since that is the configuration it applies to: cosmos (running, starts at boot), cosmos (not running, starts at boot) after s, and nothing (not at boot) after start default. The one state a user would not guess gets a colour: a scheduler that runs now but will not come back, which is what a systemctl disable by hand leaves behind, shows as (running, not at boot) in yellow; so does an enabled unit with nothing to run, which only a hand edit produces (start default disables the unit) and which at boot starts, runs nothing (exec of an empty expansion is a no-op to bash) and exits. An override in effect is still said first, with the boot state after it. scxcli get prints the same on its configured: line.

starts at boot is systemd's declaration that the unit is enabled, not a promise that the scheduler will run after the reboot; a kernel without sched_ext skips the unit, a binary gone with an upgrade fails it, and the panel learns that after the fact, from failure and kernel. The spec says so.

No new field and no new mechanism: --json is unchanged, the panel only shows what the backend already reports.

The first question after switching schedulers is whether the choice
survives a reboot. The answer is in the listing already, as
`unit.enabled`, and neither scxtui's panel nor `scxcli get` said it: a
user had to know that `start ID` runs `systemctl enable` and that
`start default` disables the unit, or go and ask systemctl. The first
tester to try scxtui worked it out in a couple of seconds and then
asked for it to be on screen.

Put it on the Configured line, since that is the configuration it
applies to: `cosmos (running, starts at boot)`, `cosmos (not running,
starts at boot)` after `s`, and `nothing (not at boot)` after `start
default`. The one state a user would not guess gets a colour: a
scheduler that runs now but will not come back, which is what a
`systemctl disable` by hand leaves behind, shows as `(running, not at
boot)` in yellow; so does an enabled unit with nothing to run, which
only a hand edit produces (`start default` disables the unit) and
which at boot starts, runs nothing (`exec` of an empty expansion is a
no-op to bash) and exits. An override in effect is still said first, with
the boot state after it. `scxcli get` prints the same on its
`configured:` line.

`starts at boot` is systemd's declaration that the unit is enabled,
not a promise that the scheduler will run after the reboot; a kernel
without sched_ext skips the unit, a binary gone with an upgrade fails
it, and the panel learns that after the fact, from `failure` and
`kernel`. The spec says so.

No new field and no new mechanism: `--json` is unchanged, the panel
only shows what the backend already reports.

Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>
@sirlucjan
sirlucjan requested a review from arighi November 9, 2026 12:13
Comment thread tools/scxtui/src/ui.rs
/// hand `systemctl disable` clear, and it belongs next to the
/// configuration it applies to.
fn configured_line(current: &Current) -> (String, Color) {
let boot = if current.unit.enabled {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small edge case, not a blocker: unit.enabled is true for both enabled and enabled-runtime (e.g., if an admin runs sudo systemctl enable --runtime scx.service), so it doesn't necessarily mean the service always starts at boot (with --runtime it disappears on reboot).

Can we distinguish persistent and runtime enablement before choosing this label? The same applies to the label in scxcli.

…boot

The first question after switching schedulers is whether the choice
survives a reboot. The answer is in the listing already, as
`unit.enabled`, and neither scxtui's panel nor `scxcli get` said it: a
user had to know that `start ID` runs `systemctl enable` and that
`start default` disables the unit, or go and ask systemctl. The first
tester to try scxtui worked it out in a couple of seconds and then
asked for it to be on screen.

`starts at boot` is systemd's declaration that the unit is enabled,
not a promise that the scheduler will run after the reboot; a kernel
without sched_ext skips the unit, a binary gone with an upgrade fails
it, and the panel learns that after the fact, from `failure` and
`kernel`. The spec says so.

No new mechanism: the existing unit state now distinguishes persistent
and runtime enablement.
The JSON contract remains backward-compatible through an optional field,
and both clients render the state reported by the backend.

Signed-off-by: Piotr Gorski <lucjan.lucjanov@gmail.com>

@arighi arighi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@sirlucjan
sirlucjan added this pull request to the merge queue Nov 10, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 10, 2026
@sirlucjan
sirlucjan added this pull request to the merge queue Nov 10, 2026
Merged via the queue into main with commit 458caad Nov 10, 2026
13 of 14 checks passed
@sirlucjan
sirlucjan deleted the scxcli-fixes branch November 10, 2026 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants