Sunshine icon indicating copy to clipboard operation
Sunshine copied to clipboard

Adding as a service for autostart does not work

Open theOpheliart opened this issue 3 years ago • 5 comments

Describe the Bug

I tried configuring the autostart service as detailed in the manual. If I check the service's status it has exited with an error. Both the Couldn't find any of the following libraries and Couldn't expose some/all drm planes for card are not problematic when starting sunshine from terminal.

Expected Behavior

I expect the service to run without errors that are not also present when running from terminal.

Additional Context

No response

Host Operating System

Linux

Operating System Version

Debian GNU/Linux bookworm/sid x86_64, Kernel: 5.18.0-4-amd64

Architecture

64bit

Sunshine Version

0.14.1

GPU Type

Nvidia

GPU Model

Geforce GTX 750

GPU Driver/Mesa Version

470.141.03

Capture Method (Linux Only)

Xorg

Relevant log output

× sunshine.service - Sunshine Gamestream Server for Moonlight
     Loaded: loaded (/etc/systemd/system/sunshine.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Tue 2022-08-30 08:51:36 CEST; 3s ago
   Duration: 51ms
    Process: 3963 ExecStart=/usr/bin/sunshine (code=exited, status=4)
   Main PID: 3963 (code=exited, status=4)
        CPU: 30ms

Aug 30 08:51:36 Voyager systemd[1]: Started Sunshine Gamestream Server for Moonlight.
Aug 30 08:51:36 Voyager sunshine[3963]: [2022:08:30:08:51:36]: Error: Couldn't find any of the following libraries: [libnvidia-fbc.so.1, libnvidia-fbc.so]
Aug 30 08:51:36 Voyager sunshine[3963]: [2022:08:30:08:51:36]: Error: Couldn't expose some/all drm planes for card: /dev/dri/card1
Aug 30 08:51:36 Voyager systemd[1]: sunshine.service: Main process exited, code=exited, status=4/NOPERMISSION
Aug 30 08:51:36 Voyager systemd[1]: sunshine.service: Failed with result 'exit-code'.

theOpheliart avatar Aug 30 '22 07:08 theOpheliart

Please share the output of the following commands:

  • groups
  • cat /etc/udev/rules.d/85-sunshine.rules
  • ~/.config/systemd/user/sunshine.service

ReenigneArcher avatar Aug 30 '22 16:08 ReenigneArcher

Output of groups marit cdrom floppy sudo audio dip video plugdev users input netdev bluetooth lpadmin scanner Output of cat /etc/udev/rules.d/85-sunshine.rules KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput" Output of ~/.config/systemd/user/sunshine.service bash: /home/marit/.config/systemd/user/sunshine.service: Permission denied

theOpheliart avatar Aug 30 '22 16:08 theOpheliart

How is permission denied of a file in your home directory?

ReenigneArcher avatar Aug 30 '22 17:08 ReenigneArcher

I have no clue. I just recreated the file, in accordance with the documentation (https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/usage.html#linux) and I've got read and write privileges for it. Even if I run that file I get the same problem. Maybe it's a problem with my installation. Sunshine will not work on my system unless I run it as superuser. I just assumed that was how it was supposed to work, but that might explain my problem.

theOpheliart avatar Aug 30 '22 17:08 theOpheliart

I have a pretty good guess what actually went wrong. (I can't say for sure as I reinstalled my operating system to resolve another issue) According to the manual there is some additional setup that is not supposed to be required when you use the deb package. That appears to be incorrect. If I add these additional steps, the autostart service works almost as intended. (allthough sunshine still needs to be run as Super User when starting from terminal) I also have to manually restart the service once after boot, otherwise I can not connect and the service is shown as inactive.

theOpheliart avatar Sep 03 '22 18:09 theOpheliart

This issue is stale because it has been open for 90 days with no activity. Comment or remove the stale label, otherwise this will be closed in 10 days.

LizardByte-bot avatar Dec 03 '22 00:12 LizardByte-bot

This issue was closed because it has been stalled for 10 days with no activity.

LizardByte-bot avatar Dec 13 '22 00:12 LizardByte-bot

I'm running into the same problem, running sunshine through systemd as a user or directly in a ssh terminal seem to give this exact error, tho running sunshine from the host directly or throw a xpra remote terminal seem to launch fine (tho doesn't have working input, probably because sunshine might be meant to run only on x servers that have hardware acceleration) It might be that there is no monitor currently connected tho, I will investigate when I have more time.

creeloper27 avatar Feb 27 '23 21:02 creeloper27

I have a similar issue to this running Fedora. Sunshine is starting but it can't find any encoders. I login via ssh and stop and start the sunshine service and all is well. I'm not sure if there is a race condition happening or not.

hayrun-st avatar Jul 20 '23 21:07 hayrun-st

Gnome - Sunshine autostart creating problems. I have to manually start via command for it to work.

ar-nadeem avatar Aug 06 '23 21:08 ar-nadeem