Selaa lähdekoodia

Adds check for A.L.F.R.E.D major version > 2013 and sends
ffpb-debug-report on crash.

As it is only assumed that the bug, which causes A.L.F.R.E.D. 2013.4 to
crash, got fixed in 2014.1, it is important to know whether or not this
really is the case. Hence, an additional check got implemented that
tests for the A.L.F.R.E.D. daemon's major version. If the major version
is greater than 2013 an additional ffpb-debug-report gets issued
automatically, so that the dev-team gets informed about the crash.

Stefan Laudemann 9 vuotta sitten
vanhempi
commit
a86893e25c
1 muutettua tiedostoa jossa 6 lisäystä ja 5 poistoa
  1. 6 5
      ffpb/ffpb-alfred-watchdog/files/bin/ffpb-alfred-watchdog

+ 6 - 5
ffpb/ffpb-alfred-watchdog/files/bin/ffpb-alfred-watchdog

@@ -1,6 +1,7 @@
 #!/bin/sh
 
 LOCK_FILE="/tmp/.alfred_watchdog_lock"
+ALFRED_MAJOR_VERSION=`/usr/sbin/alfred --version | awk 'NR==1{print substr($0,18,4)};'`
 
 [[ -e ${LOCK_FILE} ]] && exit 0;
 
@@ -8,13 +9,13 @@ LOCK_FILE="/tmp/.alfred_watchdog_lock"
 
 rand=`tr -cd 0-9 </dev/urandom | head -c 32`
 delay=`expr ${rand} % 55`
-sleep ${delay}m
-                                                
+#sleep ${delay}m
+
 /usr/sbin/alfred -b bat0 -r 158 > /dev/null 2&>1
-if [[ "$?" == 255 ]] ; then                                                                                      
+if [[ "$?" == 255 ]] ; then
     logger -s -t ffpb-alfred-watchdog -p local0.info "A.L.F.R.E.D. appears to be dead. Triggering a restart now."
     /etc/init.d/alfred restart > /dev/null 2&>1
+    [[ "$ALFRED_MAJOR_VERSION" -gt 2013 ]] && /bin/ffpb-debug > /dev/null 2&>1
 fi
-                                             
-[[ -e ${LOCK_FILE} ]] && /bin/rm ${LOCK_FILE}
 
+[[ -e ${LOCK_FILE} ]] && /bin/rm ${LOCK_FILE}