From a86893e25c09a19711302d78a684046e6b6c9742 Mon Sep 17 00:00:00 2001 From: Stefan Laudemann <thisco@webcake.de> Date: Mon, 17 Nov 2014 03:58:06 +0100 Subject: [PATCH] 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. --- .../files/bin/ffpb-alfred-watchdog | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ffpb/ffpb-alfred-watchdog/files/bin/ffpb-alfred-watchdog b/ffpb/ffpb-alfred-watchdog/files/bin/ffpb-alfred-watchdog index 20f5480..ccae1bc 100755 --- a/ffpb/ffpb-alfred-watchdog/files/bin/ffpb-alfred-watchdog +++ b/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} -- GitLab