summaryrefslogtreecommitdiffstats
path: root/build_tools/clarch/larch/profiles/i686-testing-local-httpd
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2008-12-04 16:12:07 (GMT)
committerJames Meyer <james.meyer@operamail.com>2008-12-04 16:12:07 (GMT)
commit3c4a93caae5163c0bb80d149da1d74e2fcabb4c6 (patch)
treeec9866a5255f5f3d04ada337bd78dae938558020 /build_tools/clarch/larch/profiles/i686-testing-local-httpd
parent911438996409c9a7450eda941c98d9e9019c8be4 (diff)
downloadlinhes_dev-3c4a93caae5163c0bb80d149da1d74e2fcabb4c6.zip
check to make sure mysql& mythconverg are working before starting the install.
Currently it's limited to 20 attempts before aborting. closes FS#23
Diffstat (limited to 'build_tools/clarch/larch/profiles/i686-testing-local-httpd')
-rwxr-xr-xbuild_tools/clarch/larch/profiles/i686-testing-local-httpd/rootoverlay/etc/rc.local46
1 files changed, 43 insertions, 3 deletions
diff --git a/build_tools/clarch/larch/profiles/i686-testing-local-httpd/rootoverlay/etc/rc.local b/build_tools/clarch/larch/profiles/i686-testing-local-httpd/rootoverlay/etc/rc.local
index fe7cfa6..1047ce4 100755
--- a/build_tools/clarch/larch/profiles/i686-testing-local-httpd/rootoverlay/etc/rc.local
+++ b/build_tools/clarch/larch/profiles/i686-testing-local-httpd/rootoverlay/etc/rc.local
@@ -5,13 +5,53 @@
. /etc/profile
. ${MV_ROOT}/bin/install_functions.sh
+function mysql_check {
+ mysql -e "show databases;" 2>/dev/null >/dev/null
+ return $?
+}
+
+function mythconverg_check {
+ mysql mythconverg -e "describe settings;" 2>/dev/null >/dev/null
+ return $?
+}
+
+function install_db {
+ pacman --noconfirm -R mythdb-initial 2>/dev/null > /dev/null
+ pacman -S --noconfirm mythdb-initial 2>/dev/null > /dev/null
+}
+
+
#check network parms
init_network
+#check to see if mysql is running
+ATTEMPT=0
+mysql_check && install_db
+mythconverg_check
+status=$?
+while [ ! $status = 0 ]
+do
+ ((ATTEMPT=ATTEMPT+1))
+ /etc/rc.d/mysqld stop
+ sleep 2
+ /etc/rc.d/mysqld start
+ mysqlstatus=$?
+ if [ $mysqlstatus = 0 ]
+ then
+ mysql_check && install_db
+ mythconverg_check
+ status=$?
+ fi
+ if [ $ATTEMPT = 20 ]
+ then
+ echo "Could not start mysql or install mythconverg within 20 attempts"
+ echo "Aborting install"
+ exit 20
+ fi
+done
+
-#install initial database
-pacman -S --noconfirm mythdb-initial 2>/dev/null
#search for remote
init_remote
@@ -26,7 +66,7 @@ else
fi
-# Set up automatically logged in user (larch live system only)
+# Set up automatically logged in user
if [ -f /.livesys/autologin ]; then
cp /.livesys/autologin /tmp/newuser
fi