Use xdg-desktop-autostart.target for systemd service.#901
Use xdg-desktop-autostart.target for systemd service.#901ReenigneArcher merged 1 commit intoLizardByte:nightlyfrom
Conversation
|
This seems to cause problems for me in KDE: |
|
@KuleRucket Hmm, I'm also using plasma and don't seem to have this issue. I've been trying to figure out a way to ensure the systemd service of sunshine to run after kwin has started (otherwise kwin will fail to start), and this was the only way I could find. I'll keep looking though, thanks for reporting the issue! |
|
I use login/logout scripts as mentioned in #78 |
|
I tried it for myself and it works great on Kubuntu 22.10, can't wait to see it upstream! I used timer unit before. |
|
Tried this again and I don't get a cyclic service dependency and longer. I think that there might have been local changes to the service in place when I tested it. Having said that, it doesn't work for me but it's no worse than before. If it fixes things for others then it should be merged. |
|
Actually, it does work. I realised that I needed to disable/enable the service again to pick up the [Install] changes. |
7b92f2c to
d0a7d3e
Compare
|
Hi, I just wanted to point out that the newly merged systemd unit doesn't seem to work on my setup. (I tested it with a recent test build, the one from #93.) As far as I can tell the boot/login sequence never calls/reaches the xdg target. I'll continue using my own |
Same here on Manjaro Gnome X11. |
|
I think the real solution to all of this is to re-work sunshine initialisation so that it can start up without any UI/desktop environment being present rather than trying to find a systemd target that works on every DE. It can initialise the display elements later once it becomes available. I have an idea that the web server configuration should be present regardless of what issues there are in the screen capture/encoding set up so that you can adjust settings even if the rest is broken. |
There were some attempts to improve on this, but I don't think we're catching all crashes right now. |
|
I faced with the same problem on KDE X11 (Sunshine v0.19.1, Arch Linux): ❯ systemctl --user status sunshine.service --no-pager -l
○ sunshine.service - Sunshine is a self-hosted game stream host for Moonlight.
Loaded: loaded (/usr/lib/systemd/user/sunshine.service; enabled; preset: enabled)
Active: inactive (dead)
апр 02 11:11:22 unikum-desktop systemd[884]: xdg-desktop-autostart.target: Found ordering cycle on app-Yandex.Disk@autostart.service/start
апр 02 11:11:22 unikum-desktop systemd[884]: xdg-desktop-autostart.target: Found dependency on graphical-session.target/start
апр 02 11:11:22 unikum-desktop systemd[884]: xdg-desktop-autostart.target: Found dependency on sunshine.service/start
апр 02 11:11:22 unikum-desktop systemd[884]: xdg-desktop-autostart.target: Found dependency on xdg-desktop-autostart.target/start
апр 02 11:11:22 unikum-desktop systemd[884]: xdg-desktop-autostart.target: Job app-Yandex.Disk@autostart.service/start deleted to break ordering cycle starting with xdg-desktop-autostart.target/start
апр 02 11:11:22 unikum-desktop systemd[884]: app-snapshot\x2ddetect@autostart.service: Found ordering cycle on graphical-session.target/start
апр 02 11:11:22 unikum-desktop systemd[884]: app-snapshot\x2ddetect@autostart.service: Found dependency on sunshine.service/start
апр 02 11:11:22 unikum-desktop systemd[884]: app-snapshot\x2ddetect@autostart.service: Found dependency on xdg-desktop-autostart.target/start
апр 02 11:11:22 unikum-desktop systemd[884]: app-snapshot\x2ddetect@autostart.service: Found dependency on app-snapshot\x2ddetect@autostart.service/start
апр 02 11:11:22 unikum-desktop systemd[884]: app-snapshot\x2ddetect@autostart.service: Job sunshine.service/start deleted to break ordering cycle starting with app-snapshot\x2ddetect@autostart.service/start |
|
I confirm this does not start sunshine.service on startup after xdg on ubuntu Jammy. |
Description
This fixes an issue where sunshine could randomly start before the window manager on wayland, causing the wm to error with Device or resource busy on the kms/dri device. This would prevent the desktop from running at all, and all you would see is a black screen. This seems to happen on both gnome and plasma when using wayland (I've only tested it on plasma).
The fix is simply to have the sunshine systemd service start after xdg-desktop-autostart.target, which happens when other autostart apps run, and that's always after the window manager is ready.
Screenshot
Issues Fixed or Closed
Fixes #334
Type of Change
.github/...)Checklist
Branch Updates
LizardByte requires that branches be up-to-date before merging. This means that after any PR is merged, this branch
must be updated before it can be merged. You must also
Allow edits from maintainers.