systemtap/tests/Regression/testsuite-upstream-raw/internal-watchdog.sh
Martin Cermak 8d5d041590 Include downstream/RHEL tests
Find new home for downstream RHEL tests.  Upstream them.  The set of
tests used for fedora gating stays intact:  The gating tests are only
those having the tier1 tag set in their main.fmf file.  The testplan
plans/ci.fmf filters the others out from gating.

The set of Fedora gating tests stays the same as it was before this
change.
2022-05-10 09:56:18 +02:00

22 lines
456 B
Bash
Executable File

#/bin/bash
test -x
__TRESHOLD=$(( 240 * 60 ))
__SLEEP=$(( 15 * 60 ))
__LOG="$1"
test -z $__LOG && exit 1
test +x
echo "`date` internal watchdog $$ starting." >> $__LOG
while true; do
sleep $__SLEEP
__DELTA=$(( `date +'%s'` - `stat -c '%Y' $__LOG` ))
if [[ $__DELTA -gt $__TRESHOLD ]]; then
echo "`date` internal watchdog $$ rebooting due to inactivity." >> $__LOG
sync
sleep 1m
reboot -f
sleep 5m
fi
done