From 1079ddb46cceea1af45d5e00cdaa4b92e2a306f1 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 22 Nov 2020 17:12:29 -0500 Subject: [PATCH 1/4] Run explicit service start if restart failed Should solve the occasional bugs with the restart in the WebUI. Sometimes the service stops and then doesn't start again; this will run an explicit start action afterwards. If this doesn't fix it I'm certain there would be more tweaking that can be done. --- debian/bin/restart.sh | 6 +++--- fedora/restart.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/bin/restart.sh b/debian/bin/restart.sh index 9b64b6d728..e499bf3369 100755 --- a/debian/bin/restart.sh +++ b/debian/bin/restart.sh @@ -24,13 +24,13 @@ cmd="$( get_service_command )" echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." case $cmd in 'systemctl') - echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin" | at now + echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin || /usr/bin/sudo $( which systemctl ) start jellyfin" | at now ;; 'service') - echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart" | at now + echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart || /usr/bin/sudo $( which service ) jellyfin start" | at now ;; 'sysv') - echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart" | at now + echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart || /usr/bin/sudo /etc/init.d/jellyfin start" | at now ;; esac exit 0 diff --git a/fedora/restart.sh b/fedora/restart.sh index 9e53efecd0..e499bf3369 100755 --- a/fedora/restart.sh +++ b/fedora/restart.sh @@ -24,13 +24,13 @@ cmd="$( get_service_command )" echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." case $cmd in 'systemctl') - echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin" | at now + echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin || /usr/bin/sudo $( which systemctl ) start jellyfin" | at now ;; 'service') - echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart" | at now + echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart || /usr/bin/sudo $( which service ) jellyfin start" | at now ;; 'sysv') - echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart" | at now + echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart || /usr/bin/sudo /etc/init.d/jellyfin start" | at now ;; esac exit 0 From 97665c947865973936863edc21717c1ae5df6193 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 22 Nov 2020 17:19:39 -0500 Subject: [PATCH 2/4] Remove the `at now` hack --- debian/bin/restart.sh | 6 +++--- fedora/restart.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/bin/restart.sh b/debian/bin/restart.sh index e499bf3369..4436ea991a 100755 --- a/debian/bin/restart.sh +++ b/debian/bin/restart.sh @@ -24,13 +24,13 @@ cmd="$( get_service_command )" echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." case $cmd in 'systemctl') - echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin || /usr/bin/sudo $( which systemctl ) start jellyfin" | at now + sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin || /usr/bin/sudo $( which systemctl ) start jellyfin ;; 'service') - echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart || /usr/bin/sudo $( which service ) jellyfin start" | at now + sleep 2; /usr/bin/sudo $( which service ) jellyfin restart || /usr/bin/sudo $( which service ) jellyfin start ;; 'sysv') - echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart || /usr/bin/sudo /etc/init.d/jellyfin start" | at now + sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart || /usr/bin/sudo /etc/init.d/jellyfin start ;; esac exit 0 diff --git a/fedora/restart.sh b/fedora/restart.sh index e499bf3369..4436ea991a 100755 --- a/fedora/restart.sh +++ b/fedora/restart.sh @@ -24,13 +24,13 @@ cmd="$( get_service_command )" echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." case $cmd in 'systemctl') - echo "sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin || /usr/bin/sudo $( which systemctl ) start jellyfin" | at now + sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin || /usr/bin/sudo $( which systemctl ) start jellyfin ;; 'service') - echo "sleep 2; /usr/bin/sudo $( which service ) jellyfin restart || /usr/bin/sudo $( which service ) jellyfin start" | at now + sleep 2; /usr/bin/sudo $( which service ) jellyfin restart || /usr/bin/sudo $( which service ) jellyfin start ;; 'sysv') - echo "sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart || /usr/bin/sudo /etc/init.d/jellyfin start" | at now + sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart || /usr/bin/sudo /etc/init.d/jellyfin start ;; esac exit 0 From 6de79e03a2a68a6684dab9d298ca7224da0088b0 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 22 Nov 2020 18:32:16 -0500 Subject: [PATCH 3/4] Go back to at with lower sleep and start --- debian/bin/restart.sh | 6 +++--- fedora/restart.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/debian/bin/restart.sh b/debian/bin/restart.sh index 4436ea991a..34fce06708 100755 --- a/debian/bin/restart.sh +++ b/debian/bin/restart.sh @@ -24,13 +24,13 @@ cmd="$( get_service_command )" echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." case $cmd in 'systemctl') - sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin || /usr/bin/sudo $( which systemctl ) start jellyfin + echo "sleep 0.5; /usr/bin/sudo $( which systemctl ) start jellyfin" | at now ;; 'service') - sleep 2; /usr/bin/sudo $( which service ) jellyfin restart || /usr/bin/sudo $( which service ) jellyfin start + echo "sleep 0.5; /usr/bin/sudo $( which service ) jellyfin start" | at now ;; 'sysv') - sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart || /usr/bin/sudo /etc/init.d/jellyfin start + echo "sleep 0.5; /usr/bin/sudo /etc/init.d/jellyfin start" | at now ;; esac exit 0 diff --git a/fedora/restart.sh b/fedora/restart.sh index 4436ea991a..34fce06708 100755 --- a/fedora/restart.sh +++ b/fedora/restart.sh @@ -24,13 +24,13 @@ cmd="$( get_service_command )" echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." case $cmd in 'systemctl') - sleep 2; /usr/bin/sudo $( which systemctl ) restart jellyfin || /usr/bin/sudo $( which systemctl ) start jellyfin + echo "sleep 0.5; /usr/bin/sudo $( which systemctl ) start jellyfin" | at now ;; 'service') - sleep 2; /usr/bin/sudo $( which service ) jellyfin restart || /usr/bin/sudo $( which service ) jellyfin start + echo "sleep 0.5; /usr/bin/sudo $( which service ) jellyfin start" | at now ;; 'sysv') - sleep 2; /usr/bin/sudo /etc/init.d/jellyfin restart || /usr/bin/sudo /etc/init.d/jellyfin start + echo "sleep 0.5; /usr/bin/sudo /etc/init.d/jellyfin start" | at now ;; esac exit 0 From 91dd95faa3d3cd108c2cfc7a26af792f37e937be Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sun, 22 Nov 2020 18:32:34 -0500 Subject: [PATCH 4/4] Add at to the dependencies on Fedora (as in Deb) --- fedora/jellyfin.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fedora/jellyfin.spec b/fedora/jellyfin.spec index 13305488e2..197126ee56 100644 --- a/fedora/jellyfin.spec +++ b/fedora/jellyfin.spec @@ -40,7 +40,7 @@ Jellyfin is a free software media system that puts you in control of managing an Summary: The Free Software Media System Server backend Requires(pre): shadow-utils Requires: ffmpeg -Requires: libcurl, fontconfig, freetype, openssl, glibc libicu +Requires: libcurl, fontconfig, freetype, openssl, glibc, libicu, at %description server The Jellyfin media server backend.