LizardByte / Sunshine

Self-hosted game stream host for Moonlight.
http://app.lizardbyte.dev/Sunshine/
GNU General Public License v3.0
19.57k stars 950 forks source link

Adding as a service for autostart does not work #348

Closed theOpheliart closed 1 year ago

theOpheliart commented 2 years ago

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'.
ReenigneArcher commented 2 years ago

Please share the output of the following commands:

theOpheliart commented 2 years ago

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

ReenigneArcher commented 2 years ago

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

theOpheliart commented 2 years ago

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 commented 2 years ago

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.

LizardByte-bot commented 1 year ago

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 commented 1 year ago

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

creeloper27 commented 1 year ago

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.

hayrun-st commented 1 year ago

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.

ar-nadeem commented 1 year ago

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