Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(linux): make service start after desktop target #3670

Closed
wants to merge 1 commit into from

Conversation

whacka
Copy link

@whacka whacka commented Feb 17, 2025

Description

Starting the Sunshine service at the same time as the desktop causes a race condition, this is currently solved with a delay.
My service file was missing the delay (#3653), but I wanted to find a solution without the delay.
I've added an After= dependency for the desktop, which should prevent the service from starting until the desktop has loaded. This avoids the need for the delay, so I've removed it.
This is working on my system (Fedora 41 with KDE), but I'm not sure whether other desktop environments need testing.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

Starting the Sunshine service at the same time as the desktop causes a race condition, this is currently solved with a delay.
I've added an After= dependency for the desktop, which should prevent the service from starting until the desktop has loaded. I've also commented out the delay, since this would not be needed.
This is working on my system (Fedora 41 with KDE), but I haven't tested other desktop environments.
@ReenigneArcher
Copy link
Member

ReenigneArcher commented Feb 17, 2025

@whacka Thank you for the PR, but I am not sure we can add this.

Please see #2691 and the mentioned issue.

Maybe with your changes it won't trigger this issue because it doesn't include PartOf and Wants? If we could get testing on more distros that would be good.

@ReenigneArcher ReenigneArcher changed the title Update Linux service to start after desktop target fix(linux): make service start after desktop target Feb 17, 2025
@whacka
Copy link
Author

whacka commented Feb 20, 2025

Thanks for letting me know, I didn't see that there was a bug on some systems when using the dependencies. The issue looks specific to GNOME, so I'm happy to close the PR. Hopefully phasing out the hardcoded delay can reconsidered when the issue is fixed upstream.

@whacka whacka closed this Feb 20, 2025
@ReenigneArcher
Copy link
Member

@whacka do you think it might work if we didn't use the following though?

PartOf=graphical-session.target
Wants=xdg-desktop-autostart.target

These are not part of your PR, but were included when we had that previous bug. Perhaps the bug was related to just having a combination of all of them?

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.

2 participants