From: Robert Harakaly Date: Fri, 26 May 2006 12:24:22 +0000 (+0000) Subject: Added check if mysql is running, before it is started X-Git-Tag: glite-deployment-lb_R_2_2_4~24 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=e4fab77473644d51f88838ef37482400660a16b4;p=jra1mw.git Added check if mysql is running, before it is started --- diff --git a/org.glite.deployment.lb/config/scripts/glite-lb-config.py b/org.glite.deployment.lb/config/scripts/glite-lb-config.py index 7b3d37b..8b860d2 100644 --- a/org.glite.deployment.lb/config/scripts/glite-lb-config.py +++ b/org.glite.deployment.lb/config/scripts/glite-lb-config.py @@ -115,18 +115,20 @@ python %s-config [OPTION...]""" % (self.name, os.environ['GLITE_LOCATION'], \ def start(self): - print "Starting MySQL daemon ", - errorcode = os.system("/usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid=/var/lib/mysql/%s.pid --max_allowed_packet=%s &" \ - % (glib.fq_hostname,params['mysql.max_allowed_packet'])) - time.sleep(5) - if errorcode: - glib.printFailedMessage() - return errorcode - else: - glib.printOkMessage() - - if not os.path.exists('/tmp/mysql.sock'): - os.symlink('/var/lib/mysql/mysql.sock', '/tmp/mysql.sock') + pid = glib.getPID('mysqld_safe') + if pid == 0: + print "Starting MySQL daemon ", + errorcode = os.system("/usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid=/var/lib/mysql/%s.pid --max_allowed_packet=%s &" \ + % (glib.fq_hostname,params['mysql.max_allowed_packet'])) + time.sleep(5) + if errorcode: + glib.printFailedMessage() + return errorcode + else: + glib.printOkMessage() + + if not os.path.exists('/tmp/mysql.sock'): + os.symlink('/var/lib/mysql/mysql.sock', '/tmp/mysql.sock') pid = glib.getPID('bkserverd') if pid != 0: