Skip to content

Start score when the machine starts - #2184

Open
jcelerier wants to merge 1 commit into
fix/eglfs-screen-placementfrom
feature/autostart
Open

Start score when the machine starts#2184
jcelerier wants to merge 1 commit into
fix/eglfs-screen-placementfrom
feature/autostart

Conversation

@jcelerier

Copy link
Copy Markdown
Member

Stacked on #2183, which it needs: coming up without an editor is a display setting, and this passes the flag that produces it.

An appliance is a computer somebody switched on. Nobody logs into it, nobody opens a file, and when it stops nobody is there to start it again.

This first commit is the part that can be tested without touching the machine: what would be written, and what each system will honour.

Model

AutostartSettings — enabled, delay, document, autoplay, hide editor, wait for load, restart on crash, and whether to start with the machine rather than with a login.

AutostartCapabilities — what the mechanism available here can actually do, so the settings page can refuse to offer what nothing behind it will honour. A control that silently does nothing is worse than an absent one, because it is believed.

The registration carries the command line

ossia-score --no-gui --wait-load --autoplay /path/to/show.score

rather than score reading a second configuration at startup. It reuses flags that already exist, the unit says what it does, and it can be pasted into a terminal when it does not do it.

Defaults that are corrected rather than inherited

Each of these fails silently, on a machine that usually has no keyboard attached:

  • systemd gets StartLimitBurst / StartLimitIntervalSec. Unbounded restart plus a score that fails at startup is a boot loop that nobody can log in to interrupt.
  • Task Scheduler gets the same bound via RestartOnFailure/Count, plus three defaults turned off: a task refuses to start on battery, is stopped after three days by ExecutionTimeLimit, and a second trigger would start a second copy to fight the first over the audio device and the screen.
  • launchd gets ThrottleInterval, since it ignores anything under ten seconds.
  • Desktop entries can express neither a restart nor a start without a login, so the delay is spent by the command itself and the capability flags say what is missing.

runningUnderSupervisor()

A supervisor and score both restarting it gives two of them, one of which nothing is watching. Nothing uses this yet — the shortcut that already restarts score into an editor will, in a later commit.

Tests

test_unit_autostart, 13 cases: command line assembly and ordering, the presence of each guard above, boot-vs-logon scope, XML escaping of a document name containing & and <, and quoting of paths with spaces through every mechanism. All generation is pure, so none of it writes to the system.

Still to come

Backends that install and remove, status read back from the system rather than from score's own settings, the settings page, and making the editor restart supervisor-aware.

@jcelerier
jcelerier force-pushed the fix/eglfs-screen-placement branch from 98b1bd4 to 17d941b Compare August 9, 2026 23:28
@coveralls

coveralls commented Aug 10, 2026

Copy link
Copy Markdown

Coverage Status

Coverage is 15.319%feature/autostart into fix/eglfs-screen-placement. No base build found for fix/eglfs-screen-placement.

@jcelerier
jcelerier force-pushed the fix/eglfs-screen-placement branch from 17d941b to 809dde6 Compare August 10, 2026 05:05
@jcelerier
jcelerier force-pushed the fix/eglfs-screen-placement branch from 809dde6 to 3d77a23 Compare August 11, 2026 18:26
An appliance is a computer somebody switched on. Nobody logs into it,
nobody opens a file, and when it stops nobody is there to start it
again. Registering with whatever launches things at boot is small; the
systems disagree about what can be asked of them, and that disagreement
is the design.

AutostartSettings says what is wanted, AutostartCapabilities says what
the mechanism here can honour, and the generation is pure -- settings
in, unit or task or entry out -- so what will be written can be tested
without writing it anywhere.

Three defaults are corrected rather than inherited, each of which fails
silently on a machine with no keyboard. A systemd unit gets
StartLimitBurst: unbounded restart plus a score that fails at startup is
a boot loop nobody can log in to interrupt, and Task Scheduler gets the
same bound. A task also refuses to start on battery and is stopped after
three days, so both are turned off, and a second trigger is kept from
starting a second copy to fight the first over the audio device.

runningUnderSupervisor exists because a supervisor and score both
restarting it gives two of them, one unwatched. Nothing uses it yet; the
window that already restarts score into an editor will.
@jcelerier
jcelerier force-pushed the fix/eglfs-screen-placement branch from 3d77a23 to 3210a27 Compare August 18, 2026 01:08
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