Commit f6c62f3f authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Add boot script to check the DB tables for corruption before

trying to start the testbed.
parent 946585ed
#!/bin/sh
#
# Check local databases.
#
# PROVIDE: tbdbcheck
# REQUIRE: mysql
# BEFORE: testbed
# KEYWORD: shutdown
MAINSITE="@TBMAINSITE@"
PROTOGENI="@PROTOGENI_SUPPORT@"
DBNAME="@TBDBNAME@"
LOGFILE="/var/log/mysqlcheck.log"
case "$1" in
start)
rm -f $LOGFILE
if [ $MAINSITE == "0" ]; then
echo "*** Checking $DBNAME ..." >> $LOGFILE
mysqlcheck --auto-repair $DBNAME >> $LOGFILE
fi
if [ $PROTOGENI != "0" ]; then
echo "*** Checking geni ..." >> $LOGFILE
mysqlcheck --auto-repair geni >> $LOGFILE
echo "*** Checking geni-ch ..." >> $LOGFILE
mysqlcheck --auto-repair geni-ch >> $LOGFILE
echo "*** Checking geni-cm ..." >> $LOGFILE
mysqlcheck --auto-repair geni-cm >> $LOGFILE
fi
;;
stop)
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
exit 64
;;
esac
exit 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment