omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

`omarchy install service sunshine` fails: "Unit sunshine.service does not exist"

Open janoguerra opened this issue 3 months ago • 5 comments

What happened

Running omarchy install service sunshine installs the package correctly, but then fails with:

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

Because the script uses set -e, it aborts at that point, so everything after the enable step is silently skipped: the UFW streaming ports are never opened, the "Sunshine Admin" web app is not installed, and the Hyprland autostart entry is not added. The user is left with Sunshine installed but unusable from Moonlight (connection blocked by the firewall).

Cause

The sunshine package (omarchy/sunshine 2026.516.143833-4) now ships its user unit as:

/usr/lib/systemd/user/app-dev.lizardbyte.app.Sunshine.service

with Alias=sunshine.service in its [Install] section. A systemd alias only resolves after the unit is enabled, so line 74 of bin/omarchy-install-service-sunshine:

systemctl --user enable --now sunshine

fails with "Unit sunshine.service does not exist".

Fix

Enable the unit by its real name (the alias then gets created, so sunshine.service works afterwards):

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

Verified manually on the affected machine: enabling by the full name works, creates the sunshine.service alias symlink, and the service runs fine. bin/omarchy-remove-service-sunshine likely needs the same treatment for its disable step.

Steps to reproduce

  1. Fresh Omarchy install (v4.0.0) without Sunshine.
  2. Run omarchy install service sunshine.
  3. Package installs, then the enable step fails and the script aborts before opening firewall ports.

System details

  • Omarchy version: 4.0.0-1 (script also present unchanged on the quattro branch, bin/omarchy-install-service-sunshine line 74)
  • sunshine package: omarchy/sunshine 2026.516.143833-4
  • CPU: Intel Core i5-6600
  • GPU: AMD Radeon R9 M395X

janoguerra avatar Aug 16 '26 01:08 janoguerra

Confirmed on different hardware — hit the identical failure today on Omarchy 4.0.0-1 with omarchy/sunshine 2026.516.143833-4 (AMD Ryzen 9 9950X3D, RTX 5090 + AMD iGPU). Same root cause: the package's user unit is app-dev.lizardbyte.app.Sunshine.service with Alias=sunshine.service, and since an alias only resolves once the unit is enabled, systemctl --user enable --now sunshine fails on a fresh install and set -e aborts the script before the UFW rules, admin web app, and autostart entry.

Workaround verified here as well: systemctl --user enable --now app-dev.lizardbyte.app.Sunshine.service succeeds (and creates the sunshine.service alias symlink), after which the remaining steps from bin/omarchy-install-service-sunshine can be applied manually.

bandoyer avatar Aug 16 '26 21:08 bandoyer

Worth flagging for whoever picks this up: correcting the unit name alone will land #7218.

omarchy-install-service-sunshine starts Sunshine by two paths — systemctl --user enable --now sunshine, and the o.launch_on_start("sunshine") line it appends to ~/.config/hypr/autostart.lua. Today the first one aborts the script, so the second is never written and nobody sees the conflict. Make the enable --now succeed and both paths go live on the next login: two instances, the second unable to bind RTSP 48010, SIGABRT — which is #7218 exactly. The fix probably wants to drop one of the two start paths as well as correct the name.

Also confirming the alias detail above on Omarchy 4.0.0.alpha with omarchy/sunshine 2026.516.143833-4, plus one case it extends to:

$ grep -A3 '^\[Install\]' /usr/lib/systemd/user/app-dev.lizardbyte.app.Sunshine.service
[Install]
WantedBy=graphical-session.target
Alias=sunshine.service

Since systemd only materialises alias symlinks on enable, sunshine.service is unresolvable for anything that deliberately never enables the unit — not just on first install. I start Sunshine from a script instead (it has to come up after a headless output exists, because the wlr capture backend caches output_name at startup), so the alias is never created on my machine at all and systemctl --user … sunshine fails permanently. Resolving the real name is the only thing that works in that case.

NixBiks avatar Aug 20 '26 12:08 NixBiks

The diagnosis here holds on the current quattro branch: bin/omarchy-install-service-sunshine line 74 still runs systemctl --user enable --now sunshine, which names the unit's Alias= rather than the unit the package ships (app-dev.lizardbyte.app.Sunshine.service), so on a fresh install set -e stops the script before the firewall ports, the Sunshine Admin web app and the autostart line. bin/omarchy-remove-service-sunshine line 62 disables the same alias, but there the failure is swallowed by || true, so removal can leave Sunshine running while its package is removed.

As @NixBiks pointed out, correcting the name alone would turn on the second start path from #7218. #12358 fixes both: it enables and disables the real unit name, stops appending o.launch_on_start("sunshine"), and adds a migration that strips that line from existing installs. It already links this issue, so this one will close when it merges. It was run on a worker and carries verified and ready at its current head. Several later pull requests change the unit name too; #12358 is the oldest open one and the only one that also deals with the double start.

I checked the scripts on quattro and read #12358's diff. Codex at medium effort reviewed both independently. It agreed with this diagnosis and found nothing wrong in #12358, and it added the point about the removal script. Its independence is not guaranteed, because it was shown the diagnosis above. Nothing is needed from the reporter. This is waiting on the maintainer to decide on #12358. If you installed Sunshine with the broken script, run omarchy install service sunshine again after the fix lands to finish the setup.

omarchybot avatar Oct 08 '26 05:10 omarchybot

Still reproduces on Omarchy 4.5.0-3 with sunshine 2026.914.233613-1 (Ryzen 7 9700X, RTX 3090 + Granite Ridge iGPU), on a fresh install:

$ omarchy install service sunshine
Installing Sunshine...
Failed to enable unit: Unit sunshine.service does not exist

Running it again fails the same way. The package is already installed by then, so every run aborts at the same enable before the UFW rules, the web app and the autostart line. The only way to finish is to apply those steps by hand. +1 for getting #12358 merged.

rgoy avatar Nov 12 '26 18:11 rgoy

Still happens on Omarchy 4.5.0-3 with omarchy/sunshine 2026.914.233613-1 (fresh install, AMD Renoir, Hyprland 0.56.2).

omarchy install service sunshine installs the package, then stops at:

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

The package ships app-dev.lizardbyte.app.Sunshine.service. sunshine.service is only its Alias=, and that symlink is only created when the unit is enabled, so enabling by the alias fails on a first install. Because of set -e, the firewall rules, admin web app, and autostart steps never run.

Workaround: systemctl --user enable --now app-dev.lizardbyte.app.Sunshine.service, then run the rest of the script's steps by hand.

Open PRs that look like they fix this: #13230, #12358.

leopoldof3 avatar Nov 20 '26 16:11 leopoldof3