summaryrefslogtreecommitdiffstats
path: root/abs/core/LinHES-system/be_check.py
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2012-12-20 17:54:57 (GMT)
committerJames Meyer <james.meyer@operamail.com>2012-12-20 17:54:57 (GMT)
commitb1228a681e74db2c56d97e5489fa01c4f649ade4 (patch)
tree3543f17bd85fb2d9ecf9b75519bb64d0b401bddd /abs/core/LinHES-system/be_check.py
parent8fa65f7eeefe6c939e62ed55ab255706e2fd437e (diff)
downloadlinhes_pkgbuild-b1228a681e74db2c56d97e5489fa01c4f649ade4.zip
linhes_pkgbuild-b1228a681e74db2c56d97e5489fa01c4f649ade4.tar.gz
linhes_pkgbuild-b1228a681e74db2c56d97e5489fa01c4f649ade4.tar.bz2
LinHES-system: add be_check.py and modify LinHES-session to use it.
This will stop mythfrontend/mythwelcome from starting if be_check can't connect to the master backend. Mostly this was done to stop mythfronted from complaining about not being able to contact the MBE and in the worst case displaying the DB connection configuration screen. refs #886
Diffstat (limited to 'abs/core/LinHES-system/be_check.py')
-rw-r--r--abs/core/LinHES-system/be_check.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/abs/core/LinHES-system/be_check.py b/abs/core/LinHES-system/be_check.py
new file mode 100644
index 0000000..91c39dc
--- /dev/null
+++ b/abs/core/LinHES-system/be_check.py
@@ -0,0 +1,29 @@
+#!/usr/bin/python2
+#simple program to check if mythbackend is up and running
+#exit code of 0 is success, anything else means it can't connect
+import sys
+class Logger(object):
+ def __init__(self, filename="/tmp/Default.log"):
+ #self.terminal = sys.stdout
+ self.log = open(filename, "a")
+
+ def write(self, message):
+ #self.terminal.write(message)
+ self.log.write(message)
+
+sys.stdout = Logger("/tmp/be_check.log")
+
+
+from MythTV import MythBE,MythDB
+#import datetime,time,sys,subprocess
+
+
+
+
+
+try:
+ be=MythBE()
+ db = MythDB()
+except:
+ sys.exit(1)
+sys.exit(0) \ No newline at end of file