omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

omarchy install service sunshine: aborts on wrong unit name, skipping firewall/webapp/autostart

Open AsemHub opened this issue 3 months ago • 2 comments

What happened

omarchy install service sunshine aborts partway through. Sunshine gets installed, but the firewall rules, the admin web app, and the autostart entry are never applied, so Moonlight cannot reach the host and the service does not start with the session.

Installing Sunshine...
...
installing sunshine...
Failed to enable unit: Unit sunshine.service does not exist

Root cause

bin/omarchy-install-service-sunshine line 74 enables the unit by a name that does not exist yet:

systemctl --user enable --now sunshine

The sunshine package ships its unit as app-dev.lizardbyte.app.Sunshine.service:

$ pacman -Ql sunshine | grep systemd
sunshine /usr/lib/systemd/user/app-dev.lizardbyte.app.Sunshine.service

That unit does declare Alias=sunshine.service, but a systemd Alias= symlink is only created when the unit is enabled. On a clean install the alias therefore does not resolve yet, and systemctl --user enable --now sunshine fails. Because the script runs under set -e, it exits right there — before open_ufw_ports, install_admin_webapp and enable_hyprland_autostart.

The result is a half-installed service that looks installed: the package is present, but the firewall is closed, there is no admin web app, and Sunshine never starts on login.

Steps to reproduce

On a machine that has never had Sunshine installed:

omarchy install service sunshine

Observe Failed to enable unit: Unit sunshine.service does not exist and a non-zero exit, and confirm the follow-up steps were skipped:

ufw status | grep omarchy-sunshine        # no rules
ls ~/.local/share/applications | grep -i sunshine   # no admin webapp

Note that re-running the command after manually enabling the unit once will appear to work, because the alias symlink now exists — so this only reproduces from a clean state.

Expected

The installer enables the unit the package actually ships and completes all of its steps.

Suggested fix

Enable the real unit name:

systemctl --user enable --now app-dev.lizardbyte.app.Sunshine.service

Secondary observation

enable_hyprland_autostart appends o.launch_on_start("sunshine") to hypr/autostart.lua, but the shipped unit is already WantedBy=graphical-session.target. Once the unit is enabled correctly, that line starts a second instance. It may be worth dropping the autostart entry and relying on the unit, though I have only reasoned about this rather than tested the double-start.

System

  • Omarchy 4.0.1-1 (channel: stable)
  • sunshine 2026.516.143833-4 (omarchy repo)
  • systemd 261.2-1-arch
  • Hyprland 0.56.2

Verified still present on quattro @ HEAD: the file at bin/omarchy-install-service-sunshine is byte-identical to my installed copy.

I skipped the omarchy debug dump because this is a logic bug in the script, reproducible independently of hardware — happy to attach it if useful.

AsemHub avatar Aug 29 '26 16:08 AsemHub

Two open PRs address this exact Sunshine half-install failure. PR #8136 enables the canonical systemd user unit and covers fresh plus previously enabled states. PR #9104 makes the same canonical-unit correction while also opening the admin UI port and avoiding redundant autostart. Linking both approaches for consolidation.

rookepoole avatar Sep 01 '26 09:09 rookepoole

Automated duplication check: this issue looks similar to #7050, which covers the same Sunshine install fails on wrong unit name. I keep that one open and close this one to keep the discussion in one place.

If you feel this is the wrong decision, please open the issue again with a note on the difference.

bjarneo avatar Sep 20 '26 19:09 bjarneo