Browse Source

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.
Joshua M. Boniface 4 years ago
parent
commit
1079ddb46c
2 changed files with 6 additions and 6 deletions
  1. 3 3
      debian/bin/restart.sh
  2. 3 3
      fedora/restart.sh

+ 3 - 3
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

+ 3 - 3
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