Commit 4d8e3e2a by PLN (Algolia)

fix(launch): boot SuperDirt as the unit, not raw sclang in a terminal

Unifying the two launchers surfaced a divergence neither had been measured
against. The root script span raw `sclang` under setsid; the Bridge's RIG UP
went through the other gig-up, which started parvagues-sc.service. Repointing
the button at one launcher would therefore have taken it OFF systemd.

Raw sclang loses, all at once: LimitMEMLOCK=infinity and LimitNICE=-20 (which
scsynth inherits), the 10-pipewire-jack.conf drop-in this script hand-rolls as
\${wrap}, StandardOutput=journal + SyslogIdentifier (so the post window is
parseable, and so the `SuperDirt warmed` probe — which keys on the unit's
ActiveEnterTimestamp — can ever say yes), Restart=on-failure bounded 3-in-300s,
and the OOM protection: systemd's user manager ships DefaultOOMScoreAdjust=200,
and an unprotected scsynth was terminated for memory on 2026-08-15 after four
crashes in one afternoon.

None of this is new reasoning — it is parvagues-sc.service's own header, written
2026-07-27: "SuperDirt as a managed unit rather than a thing running in a
terminal somewhere". This launch path simply predates it, and the divergence was
invisible because each launcher was the only one anyone watched.

Keeps the 2026-08-01 distinction that cost an evening: a unit that is ACTIVE
while scsynth is DEAD needs a restart, because start is a no-op on an active
unit. Falls back to raw sclang, loudly, if the unit is not installed.
parent 7c0d40e3
......@@ -294,8 +294,42 @@ if scsynth_up; then
ok "SuperDirt already running — skipping boot (preload only applies to a fresh boot)."
else
gen_preload # write preload.scd so start_and_midi.scd warms the set's samples
info "starting SuperDirt (sclang start_and_midi.scd, headless)…"
open_term
# PREFER THE UNIT (2026-09-22). This script span raw `sclang` under setsid,
# which is precisely the thing parvagues-sc.service was created on 2026-07-27
# to replace — read its header: "SuperDirt as a managed unit rather than 'a
# thing running in a terminal somewhere'". Raw sclang loses, all at once:
#
# LimitMEMLOCK=infinity / LimitNICE=-20 the rlimits scsynth inherits
# the 10-pipewire-jack.conf drop-in (this script hand-rolls ${wrap})
# StandardOutput=journal + SyslogIdentifier the post window, PARSEABLE —
# and the `SuperDirt warmed` probe keys on the unit's
# ActiveEnterTimestamp, so outside systemd it can never say yes
# Restart=on-failure, bounded 3-in-300s supervision
# OOM protection installed by unit 2026-08-15: systemd's user
# manager ships DefaultOOMScoreAdjust=200, and an unprotected scsynth
# was terminated for memory after four crashes in an afternoon
#
# It stayed raw here only because this path predates the unit and nobody
# noticed the divergence: the Bridge's RIG UP went through the OTHER gig-up,
# which did start the unit. Unifying the two launchers is what surfaced it.
if systemctl --user cat parvagues-sc.service >/dev/null 2>&1; then
# A unit that is ACTIVE while scsynth is DEAD needs a RESTART, not a start:
# `start` is a no-op on an active unit. That exact case cost 2026-08-01 —
# unit green, rig mute — and distinguishing the two IS the lesson.
if systemctl --user is-active --quiet parvagues-sc.service; then
warn "SuperDirt: unit is ACTIVE but scsynth is DEAD — restarting (a green unit is not sound)."
systemctl --user restart parvagues-sc.service || warn "SuperDirt: restart failed — journalctl --user -u parvagues-sc"
else
info "starting SuperDirt (parvagues-sc.service — journal, rlimits, supervision)…"
systemctl --user start parvagues-sc.service || warn "SuperDirt: unit failed to start — journalctl --user -u parvagues-sc"
fi
else
warn "SuperDirt: parvagues-sc.service not installed — falling back to raw sclang"
warn " (no journal, no rlimits, no OOM protection: tools/rig_units.py --ensure --apply)"
info "starting SuperDirt (sclang start_and_midi.scd, headless)…"
open_term
fi
fi
# 2) wait for the rig to own MIDI
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment