From aea1901b27937e3cad4da250b4864a1acc23bd85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D1=81=D1=82=D0=B0=D0=B4=D0=B8=D0=BD=20=D0=94?= =?UTF-8?q?=D0=B0=D0=BC=D1=8F=D0=BD=D0=BE=D0=B2?= Date: Tue, 24 Jan 2023 19:57:44 +0200 Subject: [PATCH 1/2] Restart the systemd service in case of a crash Make the systemd service restart itself in case of a crash. A restart is attempted 5 seconds after a crash is detected. Additionally, if the service is restarted more than 5 times in a 500 second interval it is considered as failed and no more restart attempts are going to be made. --- sunshine.service.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sunshine.service.in b/sunshine.service.in index 157b3a4dce3..965b78719b2 100644 --- a/sunshine.service.in +++ b/sunshine.service.in @@ -1,8 +1,12 @@ [Unit] Description=@PROJECT_DESCRIPTION@ +StartLimitIntervalSec=500 +StartLimitBurst=5 [Service] ExecStart=@SUNSHINE_EXECUTABLE_PATH@ +Restart=on-failure +RestartSec=5s [Install] WantedBy=graphical-session.target From a51f65b9ae9c40ffabf150413cc7bb88d0c4226e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=BE=D1=81=D1=82=D0=B0=D0=B4=D0=B8=D0=BD=20=D0=94?= =?UTF-8?q?=D0=B0=D0=BC=D1=8F=D0=BD=D0=BE=D0=B2?= Date: Thu, 26 Jan 2023 11:57:20 +0200 Subject: [PATCH 2/2] Update the documentation --- docs/source/about/usage.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/source/about/usage.rst b/docs/source/about/usage.rst index e48aa1fcdf3..7861e52321d 100644 --- a/docs/source/about/usage.rst +++ b/docs/source/about/usage.rst @@ -87,9 +87,13 @@ Sunshine needs access to `uinput` to create mouse and gamepad events. [Unit] Description=Sunshine self-hosted game stream host for Moonlight. + StartLimitIntervalSec=500 + StartLimitBurst=5 [Service] ExecStart= + Restart=on-failure + RestartSec=5s #Flatpak Only #ExecStop=flatpak kill dev.lizardbyte.sunshine