Skip to content

feat(helper): make install-helper.sh systemd-optional (OpenRC/Artix, runit) - #57

Merged
hikaps merged 1 commit into
developfrom
feature/non-systemd-init
Aug 3, 2026
Merged

feat(helper): make install-helper.sh systemd-optional (OpenRC/Artix, runit)#57
hikaps merged 1 commit into
developfrom
feature/non-systemd-init

Conversation

@hikaps

@hikaps hikaps commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Closes #55 (tracks #54 — the Artix user who couldn't install).

Change

The helper is Type=dbus with BusName=io.github.hikaps.CouchPlayHelper, so "running" just means owning that name on the system bus — D-Bus can activate it on demand without a systemd unit. install-helper.sh now detects systemd (has_systemd: /run/systemd/system + systemctl) and branches:

  • systemd (unchanged): installs the unit, daemon-reload, enable, restart.
  • non-systemd: skips the unit + all systemctl calls; strips SystemdService= from the installed D-Bus service file (source untouched) so dbus activates via Exec= directly; reloads dbus via the existing SIGHUP fallback in reload_dbus(); warns that polkitd must be running (rc-service polkitd start / sv start polkitd).

status() reports D-Bus activated on demand (no systemd) without calling systemctl on non-systemd; uninstall() guards daemon-reload; reload_dbus() gates its systemctl reload dbus on has_systemd (the SIGHUP fallback already covered non-systemd).

Tradeoff

Without the systemd unit the helper loses the sandboxing directives (ProtectSystem, etc.) — acceptable, since the helper runs as root and needs broad access (/etc, /home, /dev/input), and most are already relaxed (ProtectSystem=false, ProtectHome=false).

Acceptance (#55)

  • install-helper.sh install succeeds on OpenRC/Artix with no systemctl present. ✓ (logic; non-systemd path skips all systemctl calls)
  • Launching the GUI D-Bus-activates the helper. ✓ (SystemdService= stripped → dbus Exec= activation)
  • status reports correctly without systemctl. ✓ (verified via simulation: D-Bus activated on demand, exit 0)

Verification

  • bash -n clean; shellcheck zero findings.
  • systemd-path regression on a Bazzite host: has_systemd=true, statusRunning + D-Bus Available (unchanged behavior).
  • non-systemd simulation (force has_systemd=false): statusD-Bus activated on demand (no systemd), no systemctl error.
  • sed-strip confirmed: installed .service keeps [D-BUS Service]/Name/Exec/User, drops only SystemdService=.
  • No C++ changes; unit suite unaffected.

…runit)

The helper is Type=dbus, so D-Bus can activate it on demand without a systemd
unit. install-helper.sh now detects systemd (has_systemd: /run/systemd/system +
systemctl) and branches:

- systemd: unchanged - installs the unit, daemon-reload, enable, restart.
- non-systemd: skips the unit + all systemctl calls; strips SystemdService= from
  the installed D-Bus service file so dbus activates via Exec= directly; reloads
  dbus via the existing SIGHUP fallback; warns that polkitd must be running.

status() reports 'D-Bus activated on demand' without systemctl on non-systemd;
uninstall() guards daemon-reload. reload_dbus() now gates its systemctl call on
has_systemd to avoid command-not-found noise.

Closes #55.
@hikaps
hikaps merged commit c38cefc into develop Aug 3, 2026
1 check passed
@hikaps
hikaps deleted the feature/non-systemd-init branch August 3, 2026 22:33
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.

1 participant