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.
pull/4554/head
Joshua M. Boniface 4 years ago
parent 3442dbbaf9
commit 1079ddb46c

@ -24,13 +24,13 @@ cmd="$( get_service_command )"
echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." echo "Detected service control platform '$cmd'; using it to restart Jellyfin..."
case $cmd in case $cmd in
'systemctl') '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') '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') '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 esac
exit 0 exit 0

@ -24,13 +24,13 @@ cmd="$( get_service_command )"
echo "Detected service control platform '$cmd'; using it to restart Jellyfin..." echo "Detected service control platform '$cmd'; using it to restart Jellyfin..."
case $cmd in case $cmd in
'systemctl') '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') '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') '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 esac
exit 0 exit 0

Loading…
Cancel
Save