From d876c5b71c0345e1070cb7dc96ff16c081fb141b Mon Sep 17 00:00:00 2001 From: Alberto Di Meglio Date: Fri, 3 Dec 2004 15:14:23 +0000 Subject: [PATCH] Added verification of GLITE_USER --- .../config/scripts/glite-lb-config.py | 21 ++++++++++++++++++++- .../config/templates/glite-lb.cfg.xml | 4 ++++ 2 files changed, 24 insertions(+), 1 deletion(-) 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 83af475..173ca7a 100644 --- a/org.glite.deployment.lb/config/scripts/glite-lb-config.py +++ b/org.glite.deployment.lb/config/scripts/glite-lb-config.py @@ -101,14 +101,29 @@ python %s-config [OPTION...]""" % (self.name, os.environ['GLITE_LOCATION'], \ mysql.start() os.system('%s/etc/init.d/glite-lb-bkserverd start' % os.environ['GLITE_LOCATION']) + return 0 + def stop(self): os.system('%s/etc/init.d/glite-lb-bkserverd stop' % os.environ['GLITE_LOCATION']) mysql.stop() + return 0 + def configure(self): - mysql.start() + + # Create the GLITE_USER if it doesn't exists + print "Creating/Verifying the GLITE_USER account %s" % os.environ['GLITE_USER'] + (uid,gid) = glib.get_user_info(os.environ['GLITE_USER']) + if uid == -1: + glib.add_user(os.environ['GLITE_USER'],os.environ['GLITE_USER']) + (uid,gid) = glib.get_user_info(os.environ['GLITE_USER']) + glib.check_dir(os.environ['GLITE_LOCATION_VAR'],0755, uid, gid) # Create the MySQL database + mysql.stop() + time.sleep(5) + mysql.start() + print '#-------------------------------------------------------------------' print ('Creating MySQL %s database.' % params['lb.database.name']) print '#-------------------------------------------------------------------' @@ -129,6 +144,8 @@ python %s-config [OPTION...]""" % (self.name, os.environ['GLITE_LOCATION'], \ time.sleep(5) mysql.start() + return 0 + #------------------------------------------------------------------------------- # Set all environment variables #------------------------------------------------------------------------------- @@ -149,6 +166,7 @@ def set_env(): glib.export('GLITE_HOST_CERT',params['host.certificate.file']) glib.export('GLITE_HOST_KEY',params['host.key.file']) + glib.export('GLITE_USER','glite') glib.export('GLOBUS_LOCATION',params['GLOBUS_LOCATION']) # bin and lib paths @@ -236,6 +254,7 @@ if __name__ == '__main__': sys.exit(1) # Start the service + service.stop() if service.start() != 0: print "An error occurred while starting the %s" % service.friendly_name sys.exit(1) diff --git a/org.glite.deployment.lb/config/templates/glite-lb.cfg.xml b/org.glite.deployment.lb/config/templates/glite-lb.cfg.xml index 0540de6..5146ca6 100644 --- a/org.glite.deployment.lb/config/templates/glite-lb.cfg.xml +++ b/org.glite.deployment.lb/config/templates/glite-lb.cfg.xml @@ -32,6 +32,10 @@ description="The location of the Globus Toolkit" value="/opt/globus"/> + + -- 1.8.2.3