Bug 24993: Make sure we are not going to loop indefinitely
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 8 Apr 2020 09:57:06 +0000 (11:57 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 14 Apr 2020 07:32:56 +0000 (08:32 +0100)
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

debian/scripts/koha-sip

index fd3c538..2a4ea79 100755 (executable)
@@ -154,8 +154,15 @@ restart_sip()
         local noLF="-n"
         [ "$verbose" != "no" ] && noLF=""
         echo $noLF `stop_sip ${name}`
+
+        MAX_ITERATION=10
         while is_sip_running ${name}; do
+            ((i++))
+            if [ $MAX_ITERATION -lt $i ]; then
+                break
+            fi
             sleep 1;
+
         done
         echo $noLF `start_sip ${name}`
     else