Sunshine Autostart not persisting between reboots

Hello, I'm trying to get sunshine to automatically start on reboot via the ujust setup-sunshine script. I'm pretty sure the autostart functionality is broken. After reboot the user service disappears and sunshine does not restart. Anyone know why systemd might not see the sunshine.service user service after reboot? The symlink is here: /home/bazzite/.config/systemd/user/xdg-desktop-autostart.target.wants/sunshine.service
6 Replies
drdoom
drdoomOPβ€’2w ago
Well, the service is missing when I systemctl --user list-units. However it does exit when I do systemctl status sunshine but it's inactive:
bazzite@bazzite:~$ systemctl status --user sunshine
β—‹ sunshine.service - Self-hosted game stream host for Moonlight
Loaded: loaded (/usr/lib/systemd/user/sunshine.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/user/service.d
└─10-timeout-abort.conf
Active: inactive (dead)
bazzite@bazzite:~$ systemctl status --user sunshine
β—‹ sunshine.service - Self-hosted game stream host for Moonlight
Loaded: loaded (/usr/lib/systemd/user/sunshine.service; enabled; preset: disabled)
Drop-In: /usr/lib/systemd/user/service.d
└─10-timeout-abort.conf
Active: inactive (dead)
Maybe it's something to do with the xdg-desktop-autostart.target not starting the service... I made a custom user service and changed WantedBy to graphical-session.target Seems to start fine now. Read-only service that's not starting after reboot:
[Unit]
Description=Self-hosted game stream host for Moonlight
StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
ExecStart=/usr/bin/sunshine
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=xdg-desktop-autostart.target
[Unit]
Description=Self-hosted game stream host for Moonlight
StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
ExecStart=/usr/bin/sunshine
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=xdg-desktop-autostart.target
New user service that restarts properly:
[Unit]
Description=Self-hosted game stream host for Moonlight
StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
ExecStart=/usr/bin/sunshine
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=graphical-session.target
[Unit]
Description=Self-hosted game stream host for Moonlight
StartLimitIntervalSec=500
StartLimitBurst=5

[Service]
ExecStart=/usr/bin/sunshine
Restart=on-failure
RestartSec=5s

[Install]
WantedBy=graphical-session.target
Could gnome not be triggering the autostart target properly?
wolfyreload
wolfyreloadβ€’2w ago
Try run ujust setup-sunshine again after rebooting. Then select the option "toggle autostart" Nevermind, looks like you came right on your own. Saw the first message and didn't see your replies afterwards 🫒
HikariKnight
HikariKnightβ€’2w ago
you need to find out why sunshine is dying on you
Rin
Rinβ€’2w ago
I had to add Sunshine to autostart in Tweaks The service just didn't run for me
drdoom
drdoomOPβ€’2w ago
@HikariKnight It's wasn't dying, there we no service logs. I think it was not even getting started.
HikariKnight
HikariKnightβ€’2w ago
Must be though since it is enabled πŸ€”
Want results from more Discord servers?
Add your server