From 43050332801491a3a5d3b61c115a2a85a8ee7cbc Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Fri, 17 Mar 2006 15:34:48 +0000 Subject: [PATCH] initial import --- org.glite.deployment.jpis/build.xml | 94 ++++ .../config/scripts/glite-jpis-config.py | 494 +++++++++++++++++++ .../config/templates/glite-jpis.cfg.xml | 88 ++++ org.glite.deployment.jpis/project/build.number | 2 + org.glite.deployment.jpis/project/build.properties | 0 .../project/glite-jp.sdf.xml.template | 117 +++++ .../project/glite-jpis.sdf.xml.template | 117 +++++ org.glite.deployment.jpis/project/lxscript-rpm.xsl | 336 +++++++++++++ org.glite.deployment.jpis/project/lxscript-tgz.xsl | 62 +++ org.glite.deployment.jpis/project/properties.xml | 66 +++ .../project/quattor-template.xsl | 64 +++ .../project/version.properties | 4 + .../bin/glite-jpps_installer.sh | 532 +++++++++++++++++++++ .../bin/glite-jpps_tgz_installer.sh | 112 +++++ .../bin/pro_software_glite_jpps.tpl | 107 +++++ org.glite.deployment.jpps/build.xml | 94 ++++ .../config/scripts/glite-jpps-config.py | 502 +++++++++++++++++++ .../config/templates/glite-jpps.cfg.xml | 85 ++++ org.glite.deployment.jpps/project/build.number | 2 + org.glite.deployment.jpps/project/build.properties | 0 .../project/glite-jpps.sdf.xml | 127 +++++ .../project/glite-jpps.sdf.xml.template | 127 +++++ org.glite.deployment.jpps/project/glite-jpps.spec | 70 +++ org.glite.deployment.jpps/project/lxscript-rpm.xsl | 336 +++++++++++++ org.glite.deployment.jpps/project/lxscript-tgz.xsl | 62 +++ org.glite.deployment.jpps/project/properties.xml | 66 +++ .../project/quattor-template.xsl | 64 +++ org.glite.deployment.jpps/project/spec.xsl | 63 +++ .../project/version.properties | 4 + 29 files changed, 3797 insertions(+) create mode 100644 org.glite.deployment.jpis/build.xml create mode 100755 org.glite.deployment.jpis/config/scripts/glite-jpis-config.py create mode 100644 org.glite.deployment.jpis/config/templates/glite-jpis.cfg.xml create mode 100644 org.glite.deployment.jpis/project/build.number create mode 100644 org.glite.deployment.jpis/project/build.properties create mode 100644 org.glite.deployment.jpis/project/glite-jp.sdf.xml.template create mode 100644 org.glite.deployment.jpis/project/glite-jpis.sdf.xml.template create mode 100644 org.glite.deployment.jpis/project/lxscript-rpm.xsl create mode 100644 org.glite.deployment.jpis/project/lxscript-tgz.xsl create mode 100644 org.glite.deployment.jpis/project/properties.xml create mode 100644 org.glite.deployment.jpis/project/quattor-template.xsl create mode 100644 org.glite.deployment.jpis/project/version.properties create mode 100644 org.glite.deployment.jpps/bin/glite-jpps_installer.sh create mode 100644 org.glite.deployment.jpps/bin/glite-jpps_tgz_installer.sh create mode 100644 org.glite.deployment.jpps/bin/pro_software_glite_jpps.tpl create mode 100644 org.glite.deployment.jpps/build.xml create mode 100755 org.glite.deployment.jpps/config/scripts/glite-jpps-config.py create mode 100644 org.glite.deployment.jpps/config/templates/glite-jpps.cfg.xml create mode 100644 org.glite.deployment.jpps/project/build.number create mode 100644 org.glite.deployment.jpps/project/build.properties create mode 100644 org.glite.deployment.jpps/project/glite-jpps.sdf.xml create mode 100644 org.glite.deployment.jpps/project/glite-jpps.sdf.xml.template create mode 100644 org.glite.deployment.jpps/project/glite-jpps.spec create mode 100644 org.glite.deployment.jpps/project/lxscript-rpm.xsl create mode 100644 org.glite.deployment.jpps/project/lxscript-tgz.xsl create mode 100644 org.glite.deployment.jpps/project/properties.xml create mode 100644 org.glite.deployment.jpps/project/quattor-template.xsl create mode 100644 org.glite.deployment.jpps/project/spec.xsl create mode 100644 org.glite.deployment.jpps/project/version.properties diff --git a/org.glite.deployment.jpis/build.xml b/org.glite.deployment.jpis/build.xml new file mode 100644 index 0000000..c2bf066 --- /dev/null +++ b/org.glite.deployment.jpis/build.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.glite.deployment.jpis/config/scripts/glite-jpis-config.py b/org.glite.deployment.jpis/config/scripts/glite-jpis-config.py new file mode 100755 index 0000000..7c347aa --- /dev/null +++ b/org.glite.deployment.jpis/config/scripts/glite-jpis-config.py @@ -0,0 +1,494 @@ +#!/usr/bin/env python +################################################################################ +# +# Copyright (c) Members of the EGEE Collaboration. 2004. +# See http://eu-egee.org/partners/ for details on the copyright holders. +# For license conditions see the license file or http://eu-egee.org/license.html +# +################################################################################ +# glite-jpis-config v. 1.0.0 +# +# Post-installation script for configuring the gLite Job Provenance Servers +# Robert Harakaly < mmulac@cern.ch > +# +# Version info: $Id$ +# +# Usage: python glite-jpis-config [-c|-v|-h|--help] +# -c, --checkconf print configuration +# -v, --version print version +# -h,--help print usage info +# --configure configure the service +# --start start the service +# --stop stop the service +# --status show service status +# +# Return codes: 0 - Ok +# 1 - Configuration failed +# +################################################################################ + +import os,string,pwd +import sys, posix, getopt,time + +sys.path.append(".") +from gLiteInstallerLib import gLib +from gLiteInstallerLib import ConfigParams +import mysql as MySQL + +# Set global variables here +global params # all config values from the XML file + +class glite_jpis: + + def __init__(self): + self.mysql = MySQL.Mysql() + self.verbose = 0 + self.version = "1.0.0" + self.name = "glite-jpis" + self.friendly_name = "gLite Job Provenance Index Server" + + #------------------------------------------------------------------------------- + # Banner + #------------------------------------------------------------------------------- + + def banner(self): + + print "\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + print "Configuring the %s" % self.friendly_name + print "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n" + + #------------------------------------------------------------------------------- + # Copyright + #------------------------------------------------------------------------------- + + def copyright(self): + + print '\nCopyright (c) Members of the EGEE Collaboration. 2004' + print 'See http://eu-egee.org/partners/ for details on the copyright holders' + print 'For license conditions see the license file or http://eu-egee.org/license.html' + + #------------------------------------------------------------------------------- + # Version + #------------------------------------------------------------------------------- + + def showVersion(self): + + print '\n%s-config v. %s\n' % (self.name,self.version) + + #------------------------------------------------------------------------------- + # Usage + #------------------------------------------------------------------------------- + + def usage(self,msg = ""): + + if msg: + print "\n%s" % (msg) + + self.copyright() + self.showVersion() + + print """Usage: \n +Edit the configuration file %s.cfg.xml in +%s/etc.config/templates\n +save it as %s/etc/config/%s.cfg.xml +and run the script as follows\n +python %s-config [OPTION...]""" % (self.name, os.environ['GLITE_LOCATION'], \ + os.environ['GLITE_LOCATION'], self.name, self.name) + + print ' -c, --checkconf print the service configuration' + print ' -v, --version print the version of the configuration script' + print ' -h, --help print this usage information' + print ' --configure configure the service' + print ' --start start the service' + print ' --stop stop the service' + print ' --status check service status' + print '\n' + + #------------------------------------------------------------------------------- + # All the configuration code goes here + #------------------------------------------------------------------------------- + + def start(self): + + self.mysql.start() + time.sleep(5) + + if not os.path.exists('/tmp/mysql.sock'): + os.symlink('/var/lib/mysql/mysql.sock', '/tmp/mysql.sock') + + #------------------------------------------------------------------- + # Start Index Server + #------------------------------------------------------------------- + + pid = glib.getPID('indexd') + if pid != 0: + print 'The gLite JP Index Server service is already running. Restarting...' + os.system('%s/etc/init.d/glite-jp-indexd stop' % os.environ['GLITE_LOCATION']) + else: + print 'Starting the gLite JP Index Server service...' + + os.system('%s/etc/init.d/glite-jp-indexd start' % os.environ['GLITE_LOCATION']) + + pid = glib.getPID('indexd') + + if (pid != 0): + print "The gLite JP Index Server service has been started ", + glib.printOkMessage() + else: + glib.printErrorMessage("Could not start the gLite JP Index Server service") + glib.printErrorMessage("Please verify and re-run the script "), + glib.printFailedMessage() + return 1 + + return 0 + + def stop(self): + + error_level = 0 + + #------------------------------------------------------------------- + # Stop Index Server + #------------------------------------------------------------------- + + pid = glib.getPID('indexd') + if (pid != 0): + os.system('%s/etc/init.d/glite-jp-indexd stop' % os.environ['GLITE_LOCATION']) + + pid = glib.getPID('indexd') + if (pid != 0): + print 'Could not stop the JP Index Server service ', + glib.printFailedMessage() + error_level = 1 + else: + print 'JP Index Server service has been stopped ', + glib.printOkMessage() + + #------------------------------------------------------------------- + # MySQL + #------------------------------------------------------------------- + + self.mysql.stop() + + return error_level + + def status(self): + + error_level = 0 + + retval = os.system('%s/etc/init.d/glite-jp-indexd status' % os.environ['GLITE_LOCATION']) + if retval != 0: + error_level = 1 + + return error_level + + def configure(self): + + #-------------------------------------------------------- + # Installs the Security Utilities + #-------------------------------------------------------- + + if os.system("python %s/glite-security-utils-config.py --subservice" % glib.getScriptPath()): + print "\nConfiguring gLite Security Utilities ", + glib.printFailedMessage() + else: + print "\nConfiguring gLite Security Utilities ", + glib.printOkMessage() + + # Create the GLITE_USER if it doesn't exists + print "\nCreating/Verifying the GLITE_USER account %s" % 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) + jpis_cert_path = pwd.getpwnam(os.environ['GLITE_USER'])[5] + "/" + params['user.certificate.path'] + glib.check_dir(jpis_cert_path ,0755, uid, gid) + glib.printOkMessage() + + # Create all directories needed + glib.check_dir(os.environ['GLITE_CERT_DIR']) + print "\nVerify CA certificates directory ", + glib.printOkMessage() + + # Copy certificates + print "\nCopy host certificates to GLITE_USER home directory as service certificates", + os.system("cp %s %s %s/" % (params['host.certificate.file'], params['host.key.file'], jpis_cert_path)) + os.chown("%s/hostcert.pem" % jpis_cert_path, uid,gid) + os.chmod("%s/hostcert.pem" % jpis_cert_path, 0644) + os.chown("%s/hostkey.pem" % jpis_cert_path, uid,gid) + os.chmod("%s/hostkey.pem" % jpis_cert_path, 0400) + glib.printOkMessage() + + #-------------------------------------------------------- + # Configure MySQL + #-------------------------------------------------------- + + # Set mysql parameters + #self.mysql.setConfiguration('client','max_allowed_packet',params['mysql.max_allowed_packet']) + self.mysql.setConfiguration('mysqld','max_allowed_packet',params['mysql.max_allowed_packet']) + + # start MySQL + self.mysql.stop() + time.sleep(5) + self.mysql.start() + + if not os.path.exists('/tmp/mysql.sock'): + os.symlink('/var/lib/mysql/mysql.sock', '/tmp/mysql.sock') + + # ------------------------------------------------------------ + # Check password of MySQL + # ------------------------------------------------------------ + + self.mysql_root_password = params['mysql.root.password'] + if not params.has_key('set.mysql.root.password'): + params['set.mysql.root.password'] = 'false' + setempty = params['set.mysql.root.password'] + if self.mysql.checkMySQLConfiguration(self.mysql_root_password,setempty): + return 1 + + # Create the MySQL database + print "\nCreate/Verify the %s database" % params['jpis.database.name'] + + # Check if database exists + if self.mysql.existsDB(params['jpis.database.name'],self.mysql_root_password) != 0: + # Create database + print ('\n==> Creating MySQL %s database\n' % params['jpis.database.name']) + + if os.path.exists('/bin/rm /tmp/mysql_ct'): + os.remove('/tmp/mysql_ct') + + file = open('/tmp/mysql_ct', 'w') + + self.mysql.add_user(params['jpis.database.name'],params['jpis.database.username'],"",self.mysql_root_password) + text = ['USE %s;\n' % params['jpis.database.name'], + '\. %s/etc/glite-jp-index-dbsetup.sql\n' % os.environ['GLITE_LOCATION']] + + file.writelines(text) + file.close() + os.system('/usr/bin/mysql -p%s < /tmp/mysql_ct' % self.mysql_root_password) + os.system('/bin/rm /tmp/mysql_ct') + + #Starting and stopping the database before the index creation + self.mysql.stop() + time.sleep(5) + self.mysql.start() + + else: + print "\n==> MySQL database %s already exist\n" % params['jpis.database.name'] + + self.mysql.stop() + + return 0 + +#------------------------------------------------------------------------------- +# Set all environment variables +#------------------------------------------------------------------------------- + +def loadDefaults(params): + + params['GLITE_LOCATION'] = "/opt/glite" + params['mysql.root.password'] = "" + params['jpis.database.name'] = "jpis" + params['jpis.database.username'] = "jpis" + params['mysql.max_allowed_packet'] = "17" + params['jpis.serviceName'] = 'JP IS Server service at %s' % glib.fq_hostname + params['jpis.serviceType'] = 'org.glite.jp.index' + params['jpis.statusScript'] = '%s/etc/init.d/glite-jp-indexd status' % params['GLITE_LOCATION'] + params['jpis.endpoint'] = 'not available' + +def set_env(): + + # gLite + glib.export('GLITE_LOCATION'); + glib.export('GLITE_LOCATION_VAR'); + if not os.path.exists(os.environ['GLITE_LOCATION_VAR']): + os.mkdir(os.environ['GLITE_LOCATION_VAR'],0755) + glib.export('GLITE_LOCATION_LOG'); + if not os.path.exists(os.environ['GLITE_LOCATION_LOG']): + os.mkdir(os.environ['GLITE_LOCATION_LOG'],0755) + glib.export('GLITE_LOCATION_TMP'); + if not os.path.exists(os.environ['GLITE_LOCATION_TMP']): + os.mkdir(os.environ['GLITE_LOCATION_TMP'],0755) + + if not params.has_key('glite.user.group'): + params['glite.user.group'] = '' + (uid,gid) = glib.add_user(params['glite.user.name'],params['glite.user.group']) + glib.export('GLITE_USER',params['glite.user.name']) + jpis_cert_path = pwd.getpwnam(os.environ['GLITE_USER'])[5] + "/" + params['user.certificate.path'] + glib.export('GLITE_HOST_CERT',"%s/hostcert.pem" % jpis_cert_path) + glib.export('GLITE_HOST_KEY',"%s/hostkey.pem" % jpis_cert_path) + glib.export('GLITE_CERT_DIR',params['ca.certificates.dir']) + + glib.export('GLOBUS_LOCATION',params['GLOBUS_LOCATION']) + glib.export('GPT_LOCATION',params['GPT_LOCATION']) + + glib.export('JAVA_HOME') + + # bin and lib paths + glib.addEnvPath("PATH","/usr/bin/:%s/bin:%s/bin:%s/externals/bin:%s/bin" \ + % (os.environ['JAVA_HOME'],os.environ['GLOBUS_LOCATION'],os.environ['GLITE_LOCATION'],os.environ['GLITE_LOCATION'])) + glib.addEnvPath("LD_LIBRARY_PATH","/usr/lib:%s/lib:%s/externals/lib:%s/lib" % (os.environ['GLOBUS_LOCATION'], os.environ['GLITE_LOCATION'],os.environ['GLITE_LOCATION'])) + + # Perl + glib.addEnvPath("PERL5LIB", "%s/lib/perl:%s/lib/perl5" % (os.environ['GPT_LOCATION'],os.environ['GLITE_LOCATION'])) + + # JP IS configuration + glib.export('GLITE_JPIS_PS',params['jpis.ps']) + glib.export('GLITE_JPIS_DEBUG',params['jpis.debug']) + glib.export('GLITE_JPIS_QT',params['jpis.qt']) + glib.export('GLITE_JPIS_AUTH',params['jpis.auth']) + glib.export('GLITE_JPIS_DB',params['jpis.db']) + glib.export('GLITE_JPIS_PORT',params['jpis.port']) + glib.export('GLITE_JPIS_PIDFILE',params['jpis.pid.file']) + glib.export('GLITE_JPIS_LOGFILE',params['jpis.log.file']) + + # Set environment + glib.setUserEnv() + +#------------------------------------------------------------------------------- +# Main program begins here +#------------------------------------------------------------------------------- + +if __name__ == '__main__': + + # The script must be run as root + if not os.geteuid()==0: + print '"\nThis script must be run as root\n' + sys.exit(1) + + # Get an instance of the ConfigParams class + params = ConfigParams() + + # Get an instance of the library class + glib = gLib() + + # Load parameters + loadDefaults(params) + try: + opts, args = glib.getopt(sys.argv[1:], '', ['siteconfig=']) + for o, a in opts: + if o == "--siteconfig": + params['site.config.url'] = a + break + except getopt.GetoptError: + pass + if glib.loadConfiguration("%s/../glite-jpis.cfg.xml" % glib.getScriptPath(),params): + print "An error occurred while configuring the service" + sys.exit(1) + + verbose = 0 + if params.has_key('glite.installer.verbose'): + if params['glite.installer.verbose'] == "true": + verbose = 1 + glib.verbose = verbose + + # Set up the environment + set_env() + + + # Instantiate the service classes + service = glite_jpis() + service.verbose = verbose + + # Command line opts if any + try: + opts, args = glib.getopt(sys.argv[1:], 'chv', ['checkconf', 'help', 'version','configure','stop','start','status','siteconfig=']) + except getopt.GetoptError: + service.usage(msg = "Unknown options(s)") + sys.exit(1) + + if len(opts) == 0: + service.usage() + sys.exit(0) + + # Check cli options + for o, a in opts: + if o in ("-h", "--help"): + service.usage() + sys.exit(0) + if o in ("-v", "--version"): + service.showVersion() + sys.exit(0) + if o in ("-c", "--checkconf"): + service.copyright() + service.showVersion() + glib.print_params(params) + sys.exit(0) + + if o == "--configure": + + + # Check certificates + if params.has_key('glite.installer.checkcerts'): + if params['glite.installer.checkcerts'] == "true": + if glib.check_certs(params) != 0: + print "An error occurred while configuring the %s service" \ + % service.friendly_name + sys.exit(1) + + # Print configuration parameters + if verbose: + glib.print_params(params) + + service.copyright() + service.showVersion() + service.banner() + + # Stop all services + glib.printInfoMessage("\n\nStopping all running JP IS services...") + service.stop() + + # Configure the service + return_result = service.configure() + + if return_result == 0: + + # Stop all services + glib.printInfoMessage("\n\nStopping all running JP IS services...") + service.stop() + + print "\n\nThe %s configuration was successfully completed\n" % service.friendly_name + print "You can now start the service using the --start option of this script\n\n" + glib.registerService() + + sys.exit(0) + + elif return_result == 2: + + # Stop all services + glib.printInfoMessage("\n\nStopping all running JP IS services...") + service.stop() + + print "\n\nThe %s configuration was completed,\n" % service.friendly_name + print "but warnings were issued. Please revise them and re-run the script\n" + print "or configure JP IS manually\n" + + sys.exit(2) + + else: + print "\n\nAn unrecoverable error occurred while configuring the %s" \ + % service.friendly_name + + sys.exit(1) + + if o in ("start", "--start"): + # Start the service + if service.start() == 0: + print "\n\nThe %s was successfully started " % service.friendly_name, + glib.printOkMessage() + sys.exit(0) + else: + print "\n\nAn error occurred while starting the %s " % service.friendly_name, + glib.printFailedMessage() + sys.exit(1) + + if o in ("stop", "--stop"): + # Stop the service + if service.stop() == 0: + print "\n\nThe %s was successfully stopped " % service.friendly_name, + glib.printOkMessage() + sys.exit(0) + else: + print "\n\nAn unrecoverable error occurred while stopping the %s " % service.friendly_name, + glib.printFailedMessage() + sys.exit(1) + if o == "--status": + sys.exit(service.status()) + diff --git a/org.glite.deployment.jpis/config/templates/glite-jpis.cfg.xml b/org.glite.deployment.jpis/config/templates/glite-jpis.cfg.xml new file mode 100644 index 0000000..ca3e6b6 --- /dev/null +++ b/org.glite.deployment.jpis/config/templates/glite-jpis.cfg.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.glite.deployment.jpis/project/build.number b/org.glite.deployment.jpis/project/build.number new file mode 100644 index 0000000..58569c4 --- /dev/null +++ b/org.glite.deployment.jpis/project/build.number @@ -0,0 +1,2 @@ +#Wed Apr 13 09:36:57 CEST 2005 +module.build=232 diff --git a/org.glite.deployment.jpis/project/build.properties b/org.glite.deployment.jpis/project/build.properties new file mode 100644 index 0000000..e69de29 diff --git a/org.glite.deployment.jpis/project/glite-jp.sdf.xml.template b/org.glite.deployment.jpis/project/glite-jp.sdf.xml.template new file mode 100644 index 0000000..d27cdec --- /dev/null +++ b/org.glite.deployment.jpis/project/glite-jp.sdf.xml.template @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.glite.deployment.jpis/project/glite-jpis.sdf.xml.template b/org.glite.deployment.jpis/project/glite-jpis.sdf.xml.template new file mode 100644 index 0000000..d27cdec --- /dev/null +++ b/org.glite.deployment.jpis/project/glite-jpis.sdf.xml.template @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.glite.deployment.jpis/project/lxscript-rpm.xsl b/org.glite.deployment.jpis/project/lxscript-rpm.xsl new file mode 100644 index 0000000..7b6c6e3 --- /dev/null +++ b/org.glite.deployment.jpis/project/lxscript-rpm.xsl @@ -0,0 +1,336 @@ + + + + + + + + + + + + + +#!/bin/sh + +# Copyright (c) Members of the EGEE Collaboration. 2004 +# See http://eu-egee.org/partners/ for details on the copyright holders +# For license conditions see the license file or http://eu-egee.org/license.html + +# glite-jpis_installer v. +# +# The glite-jpis_installer installs the gLite Job Provenance Index Server +# +# Usage: glite-jpis_installer [-u|-v|--help] +# -u uninstall +# -v print version +# --help print script usage info +# Return codes: 0 - Ok +# 1 - if a file could not be downloaded + +############################################################################### + +#Parse the RPMLIST to strip out the RPMS that are already installed +function parseRPMList() +{ + newRPMLIST="" + localRPMLIST=`rpm -qa` + for i in $RPMLIST + do + g=`echo $i | sed -e 's/\.i386\.rpm//g'` + g=`echo $g | sed -e 's/\.noarch\.rpm//g'` + if [ -z "`echo $localRPMLIST | grep $g`" ]; then + newRPMLIST="${newRPMLIST} $i" + else + echo "$i is already installed. It will be skipped." + fi + done + + RPMLIST=$newRPMLIST +} + +#Parse the SCRIPTLIST to execute all scripts +function parseScriptList() +{ + for i in $SCRIPTLIST + do + if [ "$INSTALL" = "true" ]; then + $i + else + $i -u + fi + done +} + +#Downloads and install the module RPMS +function install() +{ + + INSTALL=true + version + echo + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo x Please wait, downloading the gLite Job Provenance Index Server... x + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo + + mkdir -p glite-jpis + cd glite-jpis + + # Download global dependencies + + + true + + + + + + # Download scripts from repository + + + true + + + + + # Download dependencies RPMS from repository + + + true + + + + # Download RPMS from repository + + + true + + + + + + # Download and install subservices + parseScriptList + + + # Install all RPMS + echo + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo x Please wait, installing the gLite Job Provenance Index Server... x + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo + parseRPMList + if [ ! -z "$RPMLIST" ]; then + rpm -Uvh $RPMLIST + rpm_return=$? + else + echo All required RPMS are already installed + rpm_return=0 + fi + if [ "$rpm_return" == "0" ]; then + echo + echo Done! + echo + echo Before using the gLite JP, please create or update the configuration + echo files /opt/glite/etc/config/glite-jpis.cfg.xml + echo and /opt/glite/etc/config/glite-global.cfg.xml + echo and run the configuration script + echo /opt/glite/etc/config/scripts/glite-jpis-config.py. + echo A template is provided in + echo /opt/glite/etc/config/templates/glite-jpis.cfg.xml + echo Alternatively site configuration files can be used + else + echo + echo An error occurred while installing the JP RPMS. + echo Most likely one or more of the RPMS to be installed require + echo additional dependencies or are older than already installed packages. + echo Please refer to the rpm error message above for more details. + fi + echo + echo For more information refer to the gLite Installation and User Guides + echo or to the gLite web site \(http:\/\/www.glite.org\) + echo Please report problems and comments to the gLite Team at + echo glite-bugs@cern.ch + + cd .. +} + +############################################################################### +function uninstall() +{ + version + + # Global dependencies + + + false + + + + + + # dependencies RPMS from repository + + + false + + + + # RPMS from repository + + + false + + + + + + # Uninstall all RPMS + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo x Please wait, uninstalling the gLite Job Provenance Index Server... x + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo + rpm -ev $RPMLIST + if [ "$?" == "0" ]; then + echo + echo Done! + else + echo + echo An error occurred while removing the JP RPMS. + echo Most likely one or more of the RPMS to be removed have + echo dependent packages. + echo Please refer to the rpm error message above for more details. + fi +} + +############################################################################### +function usage() +{ + echo + echo Copyright \(c\) Members of the EGEE Collaboration. 2004 + echo See http://eu-egee.org/partners/ for details on the copyright holders + echo For license conditions see the license file or http://eu-egee.org/license.html + echo + echo glite-jpis_installer v. + echo + echo The glite-jpis_installer installs the gLite Job Provenance Index Server + echo + echo Usage: glite-jpis_installer \[-u\|-v\|--help\] + echo -u uninstall + echo -v print version + echo --help print script usage info + echo + echo Return codes: + echo 0 - Ok + echo 1 - if a file could not be downloaded + echo +} + +############################################################################### +function version +{ + echo + echo Copyright \(c\) Members of the EGEE Collaboration. 2004 + echo See http://eu-egee.org/partners/ for details on the copyright holders + echo For license conditions see the license file or http://eu-egee.org/license.html + echo + echo glite-jpis_installer v. + echo +} + + +RPMLIST= + +############################################################################### +# Main + +while getopts uvh opt +do + case $opt in + 'u') uninstall + exit 0 + ;; + 'v') version + exit 0 + ;; + 'h') usage + exit 0 + ;; + esac +done + +install + +exit 0 + + + + + _installer.sh + + +wget -N -nv +if [ ! -f "" ] +then + echo + echo ERROR: could not be downloaded! + exit 1 +fi +chmod u+x +SCRIPTLIST="$SCRIPTLIST ./" + + +SCRIPTLISTUn="$SCRIPTLISTUn ./ -u " + + + + + + + + --..rpm + -- + + +wget -N -nv +if [ ! -f "" ] +then + echo + echo ERROR: could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST " + + +RPMLIST="$RPMLIST " + + + + + + + --..rpm + -- + + +wget -N -nv /RPMS/ +if [ ! -f "" ] +then + echo + echo ERROR: could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST " + + +RPMLIST="$RPMLIST " + + + + + diff --git a/org.glite.deployment.jpis/project/lxscript-tgz.xsl b/org.glite.deployment.jpis/project/lxscript-tgz.xsl new file mode 100644 index 0000000..8b1e0c0 --- /dev/null +++ b/org.glite.deployment.jpis/project/lxscript-tgz.xsl @@ -0,0 +1,62 @@ + + + + + + + + + + + + +#!/bin/sh +# +# glite-jpis_tgz_installer +# usage: glite-jpis_tgz_installer [-u] +# -u uninstall +# +# glite-jpis_tgz_installer installs the gLite Deployment Unit from biniary tarballs +# + +PREFIX=/opt/glite + +############################################################################### +# Download global dependencies + + + +############################################################################### + + +############################################################################### +# Download dependencies RPMS from repository + + + +############################################################################### +# Download RPMS from repository + + + +############################################################################### + + + + + + --..rpm +wget + + + + -_bin.tar.gz +wget i386/tgz/ +tar -xzf $PREFIX + + + diff --git a/org.glite.deployment.jpis/project/properties.xml b/org.glite.deployment.jpis/project/properties.xml new file mode 100644 index 0000000..c80f862 --- /dev/null +++ b/org.glite.deployment.jpis/project/properties.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.glite.deployment.jpis/project/quattor-template.xsl b/org.glite.deployment.jpis/project/quattor-template.xsl new file mode 100644 index 0000000..d960582 --- /dev/null +++ b/org.glite.deployment.jpis/project/quattor-template.xsl @@ -0,0 +1,64 @@ + + + + + + + + + + +template pro_software_glite_jpis; + +# +# Copyright (c) Members of the EGEE Collaboration. 2004 +# See http://eu-egee.org/partners/ for details on the copyright holders +# For license conditions see the license file or http://eu-egee.org/license.html +# +# glite-jpis Quattor template v. +# + +## CAs + +include pro_software_glite_CA; + + + +# Global dependencies + + + + + + +# dependencies + + + + +# RPMS + + + + + +include pro_software_; + + + + + + + +"/software/packages"=pkg_repl("","-",""); + + + +"/software/packages"=pkg_repl("","-",""); + + + diff --git a/org.glite.deployment.jpis/project/version.properties b/org.glite.deployment.jpis/project/version.properties new file mode 100644 index 0000000..b6ff6e2 --- /dev/null +++ b/org.glite.deployment.jpis/project/version.properties @@ -0,0 +1,4 @@ + +module.version = 2.2.0 +module.age = 1 + \ No newline at end of file diff --git a/org.glite.deployment.jpps/bin/glite-jpps_installer.sh b/org.glite.deployment.jpps/bin/glite-jpps_installer.sh new file mode 100644 index 0000000..5558875 --- /dev/null +++ b/org.glite.deployment.jpps/bin/glite-jpps_installer.sh @@ -0,0 +1,532 @@ + +#!/bin/sh + +# Copyright (c) Members of the EGEE Collaboration. 2004 +# See http://eu-egee.org/partners/ for details on the copyright holders +# For license conditions see the license file or http://eu-egee.org/license.html + +# glite-jpps_installer v. 2.2.0 +# +# The glite-jpps_installer installs the gLite Job Provenance Primary Storage +# +# Usage: glite-jpps_installer [-u|-v|--help] +# -u uninstall +# -v print version +# --help print script usage info +# Return codes: 0 - Ok +# 1 - if a file could not be downloaded + +############################################################################### + +#Parse the RPMLIST to strip out the RPMS that are already installed +function parseRPMList() +{ + newRPMLIST="" + localRPMLIST=`rpm -qa` + for i in $RPMLIST + do + g=`echo $i | sed -e 's/\.i386\.rpm//g'` + g=`echo $g | sed -e 's/\.noarch\.rpm//g'` + if [ -z "`echo $localRPMLIST | grep $g`" ]; then + newRPMLIST="${newRPMLIST} $i" + else + echo "$i is already installed. It will be skipped." + fi + done + + RPMLIST=$newRPMLIST +} + +#Parse the SCRIPTLIST to execute all scripts +function parseScriptList() +{ + for i in $SCRIPTLIST + do + if [ "$INSTALL" = "true" ]; then + $i + else + $i -u + fi + done +} + +#Downloads and install the module RPMS +function install() +{ + + INSTALL=true + version + echo + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo x Please wait, downloading the gLite Job Provenance Primary Storage... x + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo + + mkdir -p glite-jpps + cd glite-jpps + + # Download global dependencies + + + + # Download glite-jpps-service scripts from repository + + + + # Download glite-jpps-service dependencies RPMS from repository + + +wget -N -nv http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-server-4.1.11-0.i386.rpm +if [ ! -f "MySQL-server-4.1.11-0.i386.rpm" ] +then + echo + echo ERROR: MySQL-server-4.1.11-0.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST MySQL-server-4.1.11-0.i386.rpm" + + +wget -N -nv http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-client-4.1.11-0.i386.rpm +if [ ! -f "MySQL-client-4.1.11-0.i386.rpm" ] +then + echo + echo ERROR: MySQL-client-4.1.11-0.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST MySQL-client-4.1.11-0.i386.rpm" + + +wget -N -nv http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/c-ares-1.3.0-1.slc3.i386.rpm +if [ ! -f "c-ares-1.3.0-1.slc3.i386.rpm" ] +then + echo + echo ERROR: c-ares-1.3.0-1.slc3.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST c-ares-1.3.0-1.slc3.i386.rpm" + + +wget -N -nv http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/vdt_globus_essentials-VDT1.2.2rh9-1.i386.rpm +if [ ! -f "vdt_globus_essentials-VDT1.2.2rh9-1.i386.rpm" ] +then + echo + echo ERROR: vdt_globus_essentials-VDT1.2.2rh9-1.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST vdt_globus_essentials-VDT1.2.2rh9-1.i386.rpm" + + +wget -N -nv http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/vdt_globus_data_server-VDT1.2.2rh9-1.i386.rpm +if [ ! -f "vdt_globus_data_server-VDT1.2.2rh9-1.i386.rpm" ] +then + echo + echo ERROR: vdt_globus_data_server-VDT1.2.2rh9-1.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST vdt_globus_data_server-VDT1.2.2rh9-1.i386.rpm" + + +wget -N -nv http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/gpt-VDT1.2.2rh9-1.i386.rpm +if [ ! -f "gpt-VDT1.2.2rh9-1.i386.rpm" ] +then + echo + echo ERROR: gpt-VDT1.2.2rh9-1.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST gpt-VDT1.2.2rh9-1.i386.rpm" + + +wget -N -nv http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/myproxy-1.14-EGEE.i386.rpm +if [ ! -f "myproxy-1.14-EGEE.i386.rpm" ] +then + echo + echo ERROR: myproxy-1.14-EGEE.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST myproxy-1.14-EGEE.i386.rpm" + + +wget -N -nv http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/perl-Expect.pm-1.01-9.i386.rpm +if [ ! -f "perl-Expect.pm-1.01-9.i386.rpm" ] +then + echo + echo ERROR: perl-Expect.pm-1.01-9.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST perl-Expect.pm-1.01-9.i386.rpm" + + + + # Download glite-jpps-service RPMS from repository + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/noarch/RPMS/glite-config-@org.glite.deployment.config.info.version@-@org.glite.deployment.config.info.age@.noarch.rpm +if [ ! -f "glite-config-@org.glite.deployment.config.info.version@-@org.glite.deployment.config.info.age@.noarch.rpm" ] +then + echo + echo ERROR: glite-config-@org.glite.deployment.config.info.version@-@org.glite.deployment.config.info.age@.noarch.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-config-@org.glite.deployment.config.info.version@-@org.glite.deployment.config.info.age@.noarch.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/noarch/RPMS/glite-jpps-config-2.2.0-1.noarch.rpm +if [ ! -f "glite-jpps-config-2.2.0-1.noarch.rpm" ] +then + echo + echo ERROR: glite-jpps-config-2.2.0-1.noarch.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-jpps-config-2.2.0-1.noarch.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/RPMS/glite-jp-ws-interface-1.2.0-0.i386.rpm +if [ ! -f "glite-jp-ws-interface-1.2.0-0.i386.rpm" ] +then + echo + echo ERROR: glite-jp-ws-interface-1.2.0-0.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-jp-ws-interface-1.2.0-0.i386.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/RPMS/glite-jp-common-1.2.0-1.i386.rpm +if [ ! -f "glite-jp-common-1.2.0-1.i386.rpm" ] +then + echo + echo ERROR: glite-jp-common-1.2.0-1.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-jp-common-1.2.0-1.i386.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/RPMS/glite-jp-primary-1.2.0-1.i386.rpm +if [ ! -f "glite-jp-primary-1.2.0-1.i386.rpm" ] +then + echo + echo ERROR: glite-jp-primary-1.2.0-1.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-jp-primary-1.2.0-1.i386.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/RPMS/glite-jp-server-common-1.0.0-1.i386.rpm +if [ ! -f "glite-jp-server-common-1.0.0-1.i386.rpm" ] +then + echo + echo ERROR: glite-jp-server-common-1.0.0-1.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-jp-server-common-1.0.0-1.i386.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/RPMS/glite-lb-server-1.3.7-0.i386.rpm +if [ ! -f "glite-lb-server-1.3.7-0.i386.rpm" ] +then + echo + echo ERROR: glite-lb-server-1.3.7-0.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-lb-server-1.3.7-0.i386.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/RPMS/glite-wms-utils-jobid-1.0.0-1.i386.rpm +if [ ! -f "glite-wms-utils-jobid-1.0.0-1.i386.rpm" ] +then + echo + echo ERROR: glite-wms-utils-jobid-1.0.0-1.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-wms-utils-jobid-1.0.0-1.i386.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/RPMS/glite-wms-utils-exception-1.0.0-1.i386.rpm +if [ ! -f "glite-wms-utils-exception-1.0.0-1.i386.rpm" ] +then + echo + echo ERROR: glite-wms-utils-exception-1.0.0-1.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-wms-utils-exception-1.0.0-1.i386.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/RPMS/glite-security-gsoap-plugin-1.3.0-0.i386.rpm +if [ ! -f "glite-security-gsoap-plugin-1.3.0-0.i386.rpm" ] +then + echo + echo ERROR: glite-security-gsoap-plugin-1.3.0-0.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-security-gsoap-plugin-1.3.0-0.i386.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/RPMS/glite-security-voms-api-c-${module.version}-${module.age}.i386.rpm +if [ ! -f "glite-security-voms-api-c-${module.version}-${module.age}.i386.rpm" ] +then + echo + echo ERROR: glite-security-voms-api-c-${module.version}-${module.age}.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST glite-security-voms-api-c-${module.version}-${module.age}.i386.rpm" + + + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/RPMS/gridsite-1.1.4-3.i386.rpm +if [ ! -f "gridsite-1.1.4-3.i386.rpm" ] +then + echo + echo ERROR: gridsite-1.1.4-3.i386.rpm could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST gridsite-1.1.4-3.i386.rpm" + + + + # Download glite-security-utils scripts from repository + +wget -N -nv http://glite.web.cern.ch/glite/packages/HEAD/N20060317/installers/glite-security-utils_installer.sh +if [ ! -f "glite-security-utils_installer.sh" ] +then + echo + echo ERROR: glite-security-utils_installer.sh could not be downloaded! + exit 1 +fi +chmod u+x glite-security-utils_installer.sh +SCRIPTLIST="$SCRIPTLIST ./glite-security-utils_installer.sh" + + + + # Download glite-security-utils dependencies RPMS from repository + + + # Download glite-security-utils RPMS from repository + + + # Download and install subservices + parseScriptList + + + # Install all RPMS + echo + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo x Please wait, installing the gLite Job Provenance Primary Storage... x + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo + parseRPMList + if [ ! -z "$RPMLIST" ]; then + rpm -Uvh $RPMLIST + rpm_return=$? + else + echo All required RPMS are already installed + rpm_return=0 + fi + if [ "$rpm_return" == "0" ]; then + echo + echo Done! + echo + echo Before using the gLite JP PS, please create or update the configuration + echo files /opt/glite/etc/config/glite-jpps.cfg.xml + echo and /opt/glite/etc/config/glite-global.cfg.xml + echo and run the configuration script + echo /opt/glite/etc/config/scripts/glite-jpps-config.py. + echo A template is provided in + echo /opt/glite/etc/config/templates/glite-jpps.cfg.xml + echo Alternatively site configuration files can be used + else + echo + echo An error occurred while installing the JP PS RPMS. + echo Most likely one or more of the RPMS to be installed require + echo additional dependencies or are older than already installed packages. + echo Please refer to the rpm error message above for more details. + fi + echo + echo For more information refer to the gLite Installation and User Guides + echo or to the gLite web site \(http:\/\/www.glite.org\) + echo Please report problems and comments to the gLite Team at + echo glite-bugs@cern.ch + + cd .. +} + +############################################################################### +function uninstall() +{ + version + + # Global dependencies + + + + # glite-jpps-service dependencies RPMS from repository + + +RPMLIST="$RPMLIST MySQL-server-4.1.11-0" + + +RPMLIST="$RPMLIST MySQL-client-4.1.11-0" + + +RPMLIST="$RPMLIST c-ares-1.3.0-1.slc3" + + +RPMLIST="$RPMLIST vdt_globus_essentials-VDT1.2.2rh9-1" + + +RPMLIST="$RPMLIST vdt_globus_data_server-VDT1.2.2rh9-1" + + +RPMLIST="$RPMLIST gpt-VDT1.2.2rh9-1" + + +RPMLIST="$RPMLIST myproxy-1.14-EGEE" + + +RPMLIST="$RPMLIST perl-Expect.pm-1.01-9" + + + + # glite-jpps-service RPMS from repository + + +RPMLIST="$RPMLIST glite-config-@org.glite.deployment.config.info.version@-@org.glite.deployment.config.info.age@" + + + +RPMLIST="$RPMLIST glite-jpps-config-2.2.0-1" + + + +RPMLIST="$RPMLIST glite-jp-ws-interface-1.2.0-0" + + + +RPMLIST="$RPMLIST glite-jp-common-1.2.0-1" + + + +RPMLIST="$RPMLIST glite-jp-primary-1.2.0-1" + + + +RPMLIST="$RPMLIST glite-jp-server-common-1.0.0-1" + + + +RPMLIST="$RPMLIST glite-lb-server-1.3.7-0" + + + +RPMLIST="$RPMLIST glite-wms-utils-jobid-1.0.0-1" + + + +RPMLIST="$RPMLIST glite-wms-utils-exception-1.0.0-1" + + + +RPMLIST="$RPMLIST glite-security-gsoap-plugin-1.3.0-0" + + + +RPMLIST="$RPMLIST glite-security-voms-api-c-${module.version}-${module.age}" + + + +RPMLIST="$RPMLIST gridsite-1.1.4-3" + + + + # glite-security-utils dependencies RPMS from repository + + + # glite-security-utils RPMS from repository + + + # Uninstall all RPMS + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo x Please wait, uninstalling the gLite Job Provenance Primary Storage... x + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo + rpm -ev $RPMLIST + if [ "$?" == "0" ]; then + echo + echo Done! + else + echo + echo An error occurred while removing the JP PS RPMS. + echo Most likely one or more of the RPMS to be removed have + echo dependent packages. + echo Please refer to the rpm error message above for more details. + fi +} + +############################################################################### +function usage() +{ + echo + echo Copyright \(c\) Members of the EGEE Collaboration. 2004 + echo See http://eu-egee.org/partners/ for details on the copyright holders + echo For license conditions see the license file or http://eu-egee.org/license.html + echo + echo glite-jpps_installer v. 2.2.0 + echo + echo The glite-jpps_installer installs the gLite Job Provenance Primary Storage + echo + echo Usage: glite-jpps_installer \[-u\|-v\|--help\] + echo -u uninstall + echo -v print version + echo --help print script usage info + echo + echo Return codes: + echo 0 - Ok + echo 1 - if a file could not be downloaded + echo +} + +############################################################################### +function version +{ + echo + echo Copyright \(c\) Members of the EGEE Collaboration. 2004 + echo See http://eu-egee.org/partners/ for details on the copyright holders + echo For license conditions see the license file or http://eu-egee.org/license.html + echo + echo glite-jpps_installer v. 2.2.0 + echo +} + + +RPMLIST= + +############################################################################### +# Main + +while getopts uvh opt +do + case $opt in + 'u') uninstall + exit 0 + ;; + 'v') version + exit 0 + ;; + 'h') usage + exit 0 + ;; + esac +done + +install + +exit 0 + \ No newline at end of file diff --git a/org.glite.deployment.jpps/bin/glite-jpps_tgz_installer.sh b/org.glite.deployment.jpps/bin/glite-jpps_tgz_installer.sh new file mode 100644 index 0000000..e21bd6e --- /dev/null +++ b/org.glite.deployment.jpps/bin/glite-jpps_tgz_installer.sh @@ -0,0 +1,112 @@ + +#!/bin/sh +# +# glite-jpps_tgz_installer +# usage: glite-jpps_tgz_installer [-u] +# -u uninstall +# +# glite-jpps_tgz_installer installs the gLite glite-jpps-node Deployment Unit from biniary tarballs +# + +PREFIX=/opt/glite + +############################################################################### +# Download global dependencies + + +############################################################################### + + +############################################################################### +# Download glite-jpps-service dependencies RPMS from repository + + +wget http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-server-4.1.11-0.i386.rpm + +wget http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/MySQL-client-4.1.11-0.i386.rpm + +wget http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/c-ares-1.3.0-1.slc3.i386.rpm + +wget http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/vdt_globus_essentials-VDT1.2.2rh9-1.i386.rpm + +wget http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/vdt_globus_data_server-VDT1.2.2rh9-1.i386.rpm + +wget http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/gpt-VDT1.2.2rh9-1.i386.rpm + +wget http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/myproxy-1.14-EGEE.i386.rpm + +wget http://glite.web.cern.ch/glite/packages/externals/bin/rhel30/RPMS/perl-Expect.pm-1.01-9.i386.rpm + +############################################################################### +# Download glite-jpps-service RPMS from repository + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-config-@org.glite.deployment.config.info.version@_bin.tar.gz +tar -xzf glite-config-@org.glite.deployment.config.info.version@_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-jpps-config-2.2.0_bin.tar.gz +tar -xzf glite-jpps-config-2.2.0_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-jp-ws-interface-1.2.0_bin.tar.gz +tar -xzf glite-jp-ws-interface-1.2.0_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-jp-common-1.2.0_bin.tar.gz +tar -xzf glite-jp-common-1.2.0_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-jp-primary-1.2.0_bin.tar.gz +tar -xzf glite-jp-primary-1.2.0_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-jp-server-common-1.0.0_bin.tar.gz +tar -xzf glite-jp-server-common-1.0.0_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-lb-server-1.3.7_bin.tar.gz +tar -xzf glite-lb-server-1.3.7_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-wms-utils-jobid-1.0.0_bin.tar.gz +tar -xzf glite-wms-utils-jobid-1.0.0_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-wms-utils-exception-1.0.0_bin.tar.gz +tar -xzf glite-wms-utils-exception-1.0.0_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-security-gsoap-plugin-1.3.0_bin.tar.gz +tar -xzf glite-security-gsoap-plugin-1.3.0_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/glite-security-voms-api-c-${module.version}_bin.tar.gz +tar -xzf glite-security-voms-api-c-${module.version}_bin.tar.gz $PREFIX + + + +wget http://glite.web.cern.ch/glite/packages/HEAD/N20060317/bin/rhel30/i386/tgz/gridsite-1.1.4_bin.tar.gz +tar -xzf gridsite-1.1.4_bin.tar.gz $PREFIX + + +############################################################################### + +############################################################################### +# Download glite-security-utils dependencies RPMS from repository + +############################################################################### +# Download glite-security-utils RPMS from repository + +############################################################################### + \ No newline at end of file diff --git a/org.glite.deployment.jpps/bin/pro_software_glite_jpps.tpl b/org.glite.deployment.jpps/bin/pro_software_glite_jpps.tpl new file mode 100644 index 0000000..3abbb98 --- /dev/null +++ b/org.glite.deployment.jpps/bin/pro_software_glite_jpps.tpl @@ -0,0 +1,107 @@ + +template pro_software_glite_jpps; + +# +# Copyright (c) Members of the EGEE Collaboration. 2004 +# See http://eu-egee.org/partners/ for details on the copyright holders +# For license conditions see the license file or http://eu-egee.org/license.html +# +# glite-jpps Quattor template v. 2.2.0 +# + +## CAs + +include pro_software_glite_CA; + + + +# Global dependencies + + + +# glite-jpps-service dependencies + + +"/software/packages"=pkg_repl("MySQL-server","4.1.11-0","i386"); + + +"/software/packages"=pkg_repl("MySQL-client","4.1.11-0","i386"); + + +"/software/packages"=pkg_repl("c-ares","1.3.0-1.slc3","i386"); + + +"/software/packages"=pkg_repl("vdt_globus_essentials","VDT1.2.2rh9-1","i386"); + + +"/software/packages"=pkg_repl("vdt_globus_data_server","VDT1.2.2rh9-1","i386"); + + +"/software/packages"=pkg_repl("gpt","VDT1.2.2rh9-1","i386"); + + +"/software/packages"=pkg_repl("myproxy","1.14-EGEE","i386"); + + +"/software/packages"=pkg_repl("perl-Expect.pm","1.01-9","i386"); + + + +# glite-jpps-service RPMS + + +"/software/packages"=pkg_repl("glite-config","@org.glite.deployment.config.info.version@-@org.glite.deployment.config.info.age@","noarch"); + + + +"/software/packages"=pkg_repl("glite-jpps-config","2.2.0-1","noarch"); + + + +"/software/packages"=pkg_repl("glite-jp-ws-interface","1.2.0-0","i386"); + + + +"/software/packages"=pkg_repl("glite-jp-common","1.2.0-1","i386"); + + + +"/software/packages"=pkg_repl("glite-jp-primary","1.2.0-1","i386"); + + + +"/software/packages"=pkg_repl("glite-jp-server-common","1.0.0-1","i386"); + + + +"/software/packages"=pkg_repl("glite-lb-server","1.3.7-0","i386"); + + + +"/software/packages"=pkg_repl("glite-wms-utils-jobid","1.0.0-1","i386"); + + + +"/software/packages"=pkg_repl("glite-wms-utils-exception","1.0.0-1","i386"); + + + +"/software/packages"=pkg_repl("glite-security-gsoap-plugin","1.3.0-0","i386"); + + + +"/software/packages"=pkg_repl("glite-security-voms-api-c","${module.version}-${module.age}","i386"); + + + +"/software/packages"=pkg_repl("gridsite","1.1.4-3","i386"); + + + +# glite-security-utils dependencies + + +# glite-security-utils RPMS + +include pro_software_glite_security_utils; + \ No newline at end of file diff --git a/org.glite.deployment.jpps/build.xml b/org.glite.deployment.jpps/build.xml new file mode 100644 index 0000000..c2bf066 --- /dev/null +++ b/org.glite.deployment.jpps/build.xml @@ -0,0 +1,94 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.glite.deployment.jpps/config/scripts/glite-jpps-config.py b/org.glite.deployment.jpps/config/scripts/glite-jpps-config.py new file mode 100755 index 0000000..ec3ab7f --- /dev/null +++ b/org.glite.deployment.jpps/config/scripts/glite-jpps-config.py @@ -0,0 +1,502 @@ +#!/usr/bin/env python +################################################################################ +# +# Copyright (c) Members of the EGEE Collaboration. 2004. +# See http://eu-egee.org/partners/ for details on the copyright holders. +# For license conditions see the license file or http://eu-egee.org/license.html +# +################################################################################ +# glite-jpps-config v. 1.0.0 +# +# Post-installation script for configuring the gLite Job Provenance Servers +# Robert Harakaly < mmulac@cern.ch > +# +# Version info: $Id$ +# +# Usage: python glite-jpps-config [-c|-v|-h|--help] +# -c, --checkconf print configuration +# -v, --version print version +# -h,--help print usage info +# --configure configure the service +# --start start the service +# --stop stop the service +# --status show service status +# +# Return codes: 0 - Ok +# 1 - Configuration failed +# +################################################################################ + +import os,string,pwd +import sys, posix, getopt,time + +sys.path.append(".") +from gLiteInstallerLib import gLib +from gLiteInstallerLib import ConfigParams +import mysql as MySQL + +# Set global variables here +global params # all config values from the XML file + +class glite_jpps: + + def __init__(self): + self.mysql = MySQL.Mysql() + self.verbose = 0 + self.version = "1.0.0" + self.name = "glite-jpps" + self.friendly_name = "gLite Job Provenance Primary Storage" + + #------------------------------------------------------------------------------- + # Banner + #------------------------------------------------------------------------------- + + def banner(self): + + print "\nxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + print "Configuring the %s" % self.friendly_name + print "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n" + + #------------------------------------------------------------------------------- + # Copyright + #------------------------------------------------------------------------------- + + def copyright(self): + + print '\nCopyright (c) Members of the EGEE Collaboration. 2004' + print 'See http://eu-egee.org/partners/ for details on the copyright holders' + print 'For license conditions see the license file or http://eu-egee.org/license.html' + + #------------------------------------------------------------------------------- + # Version + #------------------------------------------------------------------------------- + + def showVersion(self): + + print '\n%s-config v. %s\n' % (self.name,self.version) + + #------------------------------------------------------------------------------- + # Usage + #------------------------------------------------------------------------------- + + def usage(self,msg = ""): + + if msg: + print "\n%s" % (msg) + + self.copyright() + self.showVersion() + + print """Usage: \n +Edit the configuration file %s.cfg.xml in +%s/etc.config/templates\n +save it as %s/etc/config/%s.cfg.xml +and run the script as follows\n +python %s-config [OPTION...]""" % (self.name, os.environ['GLITE_LOCATION'], \ + os.environ['GLITE_LOCATION'], self.name, self.name) + + print ' -c, --checkconf print the service configuration' + print ' -v, --version print the version of the configuration script' + print ' -h, --help print this usage information' + print ' --configure configure the service' + print ' --start start the service' + print ' --stop stop the service' + print ' --status check service status' + print '\n' + + #------------------------------------------------------------------------------- + # All the configuration code goes here + #------------------------------------------------------------------------------- + + def start(self): + + self.mysql.start() + time.sleep(5) + + if not os.path.exists('/tmp/mysql.sock'): + os.symlink('/var/lib/mysql/mysql.sock', '/tmp/mysql.sock') + + #------------------------------------------------------------------- + # Start Primary Storage + #------------------------------------------------------------------- + + pid = glib.getPID('primarystoraged') + if pid != 0: + print 'The gLite JP Primary Storage service is already running. Restarting...' + os.system('%s/etc/init.d/glite-jp-primary stop' % os.environ['GLITE_LOCATION']) + else: + print 'Starting the gLite JP Primary Storage service...' + + os.system('%s/etc/init.d/glite-jp-primary start' % os.environ['GLITE_LOCATION']) + + pid = glib.getPID('primarystoraged') + + if (pid != 0): + print "The gLite JP Primary Storage service has been started ", + glib.printOkMessage() + else: + glib.printErrorMessage("Could not start the gLite JP Primary Storage service") + glib.printErrorMessage("Please verify and re-run the script "), + glib.printFailedMessage() + return 1 + + return 0 + + def stop(self): + + error_level = 0 + + #------------------------------------------------------------------- + # Stop Primary Storage + #------------------------------------------------------------------- + + pid = glib.getPID('primarystoraged') + if (pid != 0): + os.system('%s/etc/init.d/glite-jp-primary stop' % os.environ['GLITE_LOCATION']) + + pid = glib.getPID('primarystoraged') + if (pid != 0): + print 'Could not stop the JP Primary Storage service ', + glib.printFailedMessage() + error_level = 1 + else: + print 'JP Primary Storage service has been stopped ', + glib.printOkMessage() + + #------------------------------------------------------------------- + # MySQL + #------------------------------------------------------------------- + + self.mysql.stop() + + return error_level + + def status(self): + + error_level = 0 + + retval = os.system('%s/etc/init.d/glite-jp-primary status' % os.environ['GLITE_LOCATION']) + if retval != 0: + error_level = 1 + + return error_level + + def configure(self): + + #-------------------------------------------------------- + # Installs the Security Utilities + #-------------------------------------------------------- + + if os.system("python %s/glite-security-utils-config.py --subservice" % glib.getScriptPath()): + print "\nConfiguring gLite Security Utilities ", + glib.printFailedMessage() + else: + print "\nConfiguring gLite Security Utilities ", + glib.printOkMessage() + + # Create the GLITE_USER if it doesn't exists + print "\nCreating/Verifying the GLITE_USER account %s" % 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) + jpps_cert_path = pwd.getpwnam(os.environ['GLITE_USER'])[5] + "/" + params['user.certificate.path'] + glib.check_dir(jpps_cert_path ,0755, uid, gid) + glib.printOkMessage() + + # Create all directories needed + glib.check_dir(os.environ['GLITE_CERT_DIR']) + print "\nVerify CA certificates directory ", + glib.printOkMessage() + + # Copy certificates + print "\nCopy host certificates to GLITE_USER home directory as service certificates", + os.system("cp %s %s %s/" % (params['host.certificate.file'], params['host.key.file'], jpps_cert_path)) + os.chown("%s/hostcert.pem" % jpps_cert_path, uid,gid) + os.chmod("%s/hostcert.pem" % jpps_cert_path, 0644) + os.chown("%s/hostkey.pem" % jpps_cert_path, uid,gid) + os.chmod("%s/hostkey.pem" % jpps_cert_path, 0400) + glib.printOkMessage() + + #-------------------------------------------------------- + # Configure MySQL + #-------------------------------------------------------- + + # Set mysql parameters + #self.mysql.setConfiguration('client','max_allowed_packet',params['mysql.max_allowed_packet']) + self.mysql.setConfiguration('mysqld','max_allowed_packet',params['mysql.max_allowed_packet']) + + # start MySQL + self.mysql.stop() + time.sleep(5) + self.mysql.start() + + if not os.path.exists('/tmp/mysql.sock'): + os.symlink('/var/lib/mysql/mysql.sock', '/tmp/mysql.sock') + + # ------------------------------------------------------------ + # Check password of MySQL + # ------------------------------------------------------------ + + self.mysql_root_password = params['mysql.root.password'] + if not params.has_key('set.mysql.root.password'): + params['set.mysql.root.password'] = 'false' + setempty = params['set.mysql.root.password'] + if self.mysql.checkMySQLConfiguration(self.mysql_root_password,setempty): + return 1 + + # Create the MySQL database + print "\nCreate/Verify the %s database" % params['jpps.database.name'] + + # Check if database exists + if self.mysql.existsDB(params['jpps.database.name'],self.mysql_root_password) != 0: + # Create database + print ('\n==> Creating MySQL %s database\n' % params['jpps.database.name']) + + if os.path.exists('/bin/rm /tmp/mysql_ct'): + os.remove('/tmp/mysql_ct') + + file = open('/tmp/mysql_ct', 'w') + + self.mysql.add_user(params['jpps.database.name'],params['jpps.database.username'],"",self.mysql_root_password) + text = ['USE %s;\n' % params['jpps.database.name'], + '\. %s/etc/glite-jp-primary-dbsetup.sql\n' % os.environ['GLITE_LOCATION']] + + file.writelines(text) + file.close() + os.system('/usr/bin/mysql -p%s < /tmp/mysql_ct' % self.mysql_root_password) + os.system('/bin/rm /tmp/mysql_ct') + + #Starting and stopping the database before the index creation + self.mysql.stop() + time.sleep(5) + self.mysql.start() + + else: + print "\n==> MySQL database %s already exist\n" % params['jpps.database.name'] + + self.mysql.stop() + + return 0 + +#------------------------------------------------------------------------------- +# Set all environment variables +#------------------------------------------------------------------------------- + +def loadDefaults(params): + + params['GLITE_LOCATION'] = "/opt/glite" + params['mysql.root.password'] = "" + params['jpps.database.name'] = "jpps" + params['jpps.database.username'] = "jpps" + params['mysql.max_allowed_packet'] = "17" + params['jpps.serviceName'] = 'JP PS Server service at %s' % glib.fq_hostname + params['jpps.serviceType'] = 'org.glite.jp.primary' + params['jpps.statusScript'] = '%s/etc/init.d/glite-jp-primary status' % params['GLITE_LOCATION'] + params['jpps.endpoint'] = 'not available' + +def set_env(): + + # gLite + glib.export('GLITE_LOCATION'); + glib.export('GLITE_LOCATION_VAR'); + if not os.path.exists(os.environ['GLITE_LOCATION_VAR']): + os.mkdir(os.environ['GLITE_LOCATION_VAR'],0755) + glib.export('GLITE_LOCATION_LOG'); + if not os.path.exists(os.environ['GLITE_LOCATION_LOG']): + os.mkdir(os.environ['GLITE_LOCATION_LOG'],0755) + glib.export('GLITE_LOCATION_TMP'); + if not os.path.exists(os.environ['GLITE_LOCATION_TMP']): + os.mkdir(os.environ['GLITE_LOCATION_TMP'],0755) + + if not params.has_key('glite.user.group'): + params['glite.user.group'] = '' + (uid,gid) = glib.add_user(params['glite.user.name'],params['glite.user.group']) + glib.export('GLITE_USER',params['glite.user.name']) + jpps_cert_path = pwd.getpwnam(os.environ['GLITE_USER'])[5] + "/" + params['user.certificate.path'] + glib.export('GLITE_HOST_CERT',"%s/hostcert.pem" % jpps_cert_path) + glib.export('GLITE_HOST_KEY',"%s/hostkey.pem" % jpps_cert_path) + glib.export('GLITE_CERT_DIR',params['ca.certificates.dir']) + + glib.export('GLOBUS_LOCATION',params['GLOBUS_LOCATION']) + glib.export('GPT_LOCATION',params['GPT_LOCATION']) + + glib.export('JAVA_HOME') + + # bin and lib paths + glib.addEnvPath("PATH","/usr/bin/:%s/bin:%s/bin:%s/externals/bin:%s/bin" \ + % (os.environ['JAVA_HOME'],os.environ['GLOBUS_LOCATION'],os.environ['GLITE_LOCATION'],os.environ['GLITE_LOCATION'])) + glib.addEnvPath("LD_LIBRARY_PATH","/usr/lib:%s/lib:%s/externals/lib:%s/lib" % (os.environ['GLOBUS_LOCATION'], os.environ['GLITE_LOCATION'],os.environ['GLITE_LOCATION'])) + + # Perl + glib.addEnvPath("PERL5LIB", "%s/lib/perl:%s/lib/perl5" % (os.environ['GPT_LOCATION'],os.environ['GLITE_LOCATION'])) + + # JP PS configuration + glib.export('GLITE_JP_PRIMARY_PEERS',params['jpps.peers']) + glib.export('GLITE_JP_PRIMARY_FTP_PORT',params['jpps.ftp.port']) + glib.export('GLITE_JP_PRIMARY_INTERNAL',params['jpps.internal']) + if not os.path.exists(os.environ['GLITE_JP_PRIMARY_INTERNAL']): + os.mkdir(os.environ['GLITE_JP_PRIMARY_INTERNAL'],0755) + import socket + glib.export('GLITE_JP_PRIMARY_EXTERNAL',"gsiftp://%s:%s%s" % (socket.getfqdn(socket.gethostname()), params['jpps.ftp.port'], params['jpps.internal']) ) + if not os.path.exists(params['jpps.external']): + os.mkdir(params['jpps.external'],0755) + #glite_setenv.sh does not like variables with spaces, + #and su don't like variables with " + #glib.export('GLITE_JP_DEBUG',params['jpps.debug']) + os.environ['GLITE_JP_DEBUG']='%s' % params['jpps.debug'] + glib.export('GLITE_JP_PRIMARY_PORT',params['jpps.port']) + glib.export('GLITE_JP_PRIMARY_DBCS',params['jpps.dbcs']) + glib.export('GLITE_JP_PRIMARY_PIDFILE',params['jpps.pid.file']) + + # Set environment + glib.setUserEnv() + +#------------------------------------------------------------------------------- +# Main program begins here +#------------------------------------------------------------------------------- + +if __name__ == '__main__': + + # The script must be run as root + if not os.geteuid()==0: + print '"\nThis script must be run as root\n' + sys.exit(1) + + # Get an instance of the ConfigParams class + params = ConfigParams() + + # Get an instance of the library class + glib = gLib() + + # Load parameters + loadDefaults(params) + try: + opts, args = glib.getopt(sys.argv[1:], '', ['siteconfig=']) + for o, a in opts: + if o == "--siteconfig": + params['site.config.url'] = a + break + except getopt.GetoptError: + pass + if glib.loadConfiguration("%s/../glite-jpps.cfg.xml" % glib.getScriptPath(),params): + print "An error occurred while configuring the service" + sys.exit(1) + + verbose = 0 + if params.has_key('glite.installer.verbose'): + if params['glite.installer.verbose'] == "true": + verbose = 1 + glib.verbose = verbose + + # Set up the environment + set_env() + + + # Instantiate the service classes + service = glite_jpps() + service.verbose = verbose + + # Command line opts if any + try: + opts, args = glib.getopt(sys.argv[1:], 'chv', ['checkconf', 'help', 'version','configure','stop','start','status','siteconfig=']) + except getopt.GetoptError: + service.usage(msg = "Unknown options(s)") + sys.exit(1) + + if len(opts) == 0: + service.usage() + sys.exit(0) + + # Check cli options + for o, a in opts: + if o in ("-h", "--help"): + service.usage() + sys.exit(0) + if o in ("-v", "--version"): + service.showVersion() + sys.exit(0) + if o in ("-c", "--checkconf"): + service.copyright() + service.showVersion() + glib.print_params(params) + sys.exit(0) + + if o == "--configure": + + + # Check certificates + if params.has_key('glite.installer.checkcerts'): + if params['glite.installer.checkcerts'] == "true": + if glib.check_certs(params) != 0: + print "An error occurred while configuring the %s service" \ + % service.friendly_name + sys.exit(1) + + # Print configuration parameters + if verbose: + glib.print_params(params) + + service.copyright() + service.showVersion() + service.banner() + + # Stop all services + glib.printInfoMessage("\n\nStopping all running JP PS services...") + service.stop() + + # Configure the service + return_result = service.configure() + + if return_result == 0: + + # Stop all services + glib.printInfoMessage("\n\nStopping all running JP PS services...") + service.stop() + + print "\n\nThe %s configuration was successfully completed\n" % service.friendly_name + print "You can now start the service using the --start option of this script\n\n" + glib.registerService() + + sys.exit(0) + + elif return_result == 2: + + # Stop all services + glib.printInfoMessage("\n\nStopping all running JP PS services...") + service.stop() + + print "\n\nThe %s configuration was completed,\n" % service.friendly_name + print "but warnings were issued. Please revise them and re-run the script\n" + print "or configure JP PS manually\n" + + sys.exit(2) + + else: + print "\n\nAn unrecoverable error occurred while configuring the %s" \ + % service.friendly_name + + sys.exit(1) + + if o in ("start", "--start"): + # Start the service + if service.start() == 0: + print "\n\nThe %s was successfully started " % service.friendly_name, + glib.printOkMessage() + sys.exit(0) + else: + print "\n\nAn error occurred while starting the %s " % service.friendly_name, + glib.printFailedMessage() + sys.exit(1) + + if o in ("stop", "--stop"): + # Stop the service + if service.stop() == 0: + print "\n\nThe %s was successfully stopped " % service.friendly_name, + glib.printOkMessage() + sys.exit(0) + else: + print "\n\nAn unrecoverable error occurred while stopping the %s " % service.friendly_name, + glib.printFailedMessage() + sys.exit(1) + if o == "--status": + sys.exit(service.status()) + diff --git a/org.glite.deployment.jpps/config/templates/glite-jpps.cfg.xml b/org.glite.deployment.jpps/config/templates/glite-jpps.cfg.xml new file mode 100644 index 0000000..55b2888 --- /dev/null +++ b/org.glite.deployment.jpps/config/templates/glite-jpps.cfg.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.glite.deployment.jpps/project/build.number b/org.glite.deployment.jpps/project/build.number new file mode 100644 index 0000000..58569c4 --- /dev/null +++ b/org.glite.deployment.jpps/project/build.number @@ -0,0 +1,2 @@ +#Wed Apr 13 09:36:57 CEST 2005 +module.build=232 diff --git a/org.glite.deployment.jpps/project/build.properties b/org.glite.deployment.jpps/project/build.properties new file mode 100644 index 0000000..e69de29 diff --git a/org.glite.deployment.jpps/project/glite-jpps.sdf.xml b/org.glite.deployment.jpps/project/glite-jpps.sdf.xml new file mode 100644 index 0000000..e3840c5 --- /dev/null +++ b/org.glite.deployment.jpps/project/glite-jpps.sdf.xml @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.glite.deployment.jpps/project/glite-jpps.sdf.xml.template b/org.glite.deployment.jpps/project/glite-jpps.sdf.xml.template new file mode 100644 index 0000000..ec2b692 --- /dev/null +++ b/org.glite.deployment.jpps/project/glite-jpps.sdf.xml.template @@ -0,0 +1,127 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.glite.deployment.jpps/project/glite-jpps.spec b/org.glite.deployment.jpps/project/glite-jpps.spec new file mode 100644 index 0000000..78cf8f9 --- /dev/null +++ b/org.glite.deployment.jpps/project/glite-jpps.spec @@ -0,0 +1,70 @@ + +Summary: gLite Job Provenance Primary Storage node configuration files +Name: glite-jpps-config +Version: @MODULE.VERSION@ +Release: @MODULE.BUILD@ +Copyright:Open Source EGEE License +Vendor:EU EGEE project +Group:System/Application +Prefix:/opt/glite +BuildArch: noarch +BuildRoot:%{_builddir}/%{name}-%{version} + + +Requires:glite-config +Requires:glite-jp-ws-interface +Requires:glite-jp-common +Requires:glite-jp-primary +Requires:glite-jp-server-common +Requires:glite-lb-server +Requires:glite-wms-utils-jobid +Requires:glite-wms-utils-exception +Requires:glite-security-gsoap-plugin +Requires:glite-security-voms-api-c +Requires:gridsite +Requires:glite-security-utils-config + +Requires:MySQL-server +Requires:MySQL-client +Requires:c-ares +Requires:vdt_globus_essentials +Requires:vdt_globus_data_server +Requires:gpt +Requires:myproxy +Requires:perl-Expect.pm +Obsoletes:glite-security-voms +Source: glite-jpps.tar.gz +%define debug_package %{nil} + +%description +gLite Job Provenance Primary Storage node configuration files + +%prep + +%setup -c + +%build + +%install + +%clean + +%pre + +%post + +%preun + +%postun + +%files + %attr(755,root,root) %{prefix}/etc/config/scripts/glite-jpps-config.py + %attr(644,root,root) %{prefix}/etc/config/templates/glite-jpps.cfg.xml + %attr(644,root,root) %{prefix}/share/doc/glite-jpps/release_notes/release_notes.doc + %attr(644,root,root) %{prefix}/share/doc/glite-jpps/release_notes/release_notes.pdf + %attr(644,root,root) %{prefix}/share/doc/glite-jpps/release_notes/release_notes.html + + +%changelog + + \ No newline at end of file diff --git a/org.glite.deployment.jpps/project/lxscript-rpm.xsl b/org.glite.deployment.jpps/project/lxscript-rpm.xsl new file mode 100644 index 0000000..c9bec9a --- /dev/null +++ b/org.glite.deployment.jpps/project/lxscript-rpm.xsl @@ -0,0 +1,336 @@ + + + + + + + + + + + + + +#!/bin/sh + +# Copyright (c) Members of the EGEE Collaboration. 2004 +# See http://eu-egee.org/partners/ for details on the copyright holders +# For license conditions see the license file or http://eu-egee.org/license.html + +# glite-jpps_installer v. +# +# The glite-jpps_installer installs the gLite Job Provenance Primary Storage +# +# Usage: glite-jpps_installer [-u|-v|--help] +# -u uninstall +# -v print version +# --help print script usage info +# Return codes: 0 - Ok +# 1 - if a file could not be downloaded + +############################################################################### + +#Parse the RPMLIST to strip out the RPMS that are already installed +function parseRPMList() +{ + newRPMLIST="" + localRPMLIST=`rpm -qa` + for i in $RPMLIST + do + g=`echo $i | sed -e 's/\.i386\.rpm//g'` + g=`echo $g | sed -e 's/\.noarch\.rpm//g'` + if [ -z "`echo $localRPMLIST | grep $g`" ]; then + newRPMLIST="${newRPMLIST} $i" + else + echo "$i is already installed. It will be skipped." + fi + done + + RPMLIST=$newRPMLIST +} + +#Parse the SCRIPTLIST to execute all scripts +function parseScriptList() +{ + for i in $SCRIPTLIST + do + if [ "$INSTALL" = "true" ]; then + $i + else + $i -u + fi + done +} + +#Downloads and install the module RPMS +function install() +{ + + INSTALL=true + version + echo + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo x Please wait, downloading the gLite Job Provenance Primary Storage... x + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo + + mkdir -p glite-jpps + cd glite-jpps + + # Download global dependencies + + + true + + + + + + # Download scripts from repository + + + true + + + + + # Download dependencies RPMS from repository + + + true + + + + # Download RPMS from repository + + + true + + + + + + # Download and install subservices + parseScriptList + + + # Install all RPMS + echo + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo x Please wait, installing the gLite Job Provenance Primary Storage... x + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo + parseRPMList + if [ ! -z "$RPMLIST" ]; then + rpm -Uvh $RPMLIST + rpm_return=$? + else + echo All required RPMS are already installed + rpm_return=0 + fi + if [ "$rpm_return" == "0" ]; then + echo + echo Done! + echo + echo Before using the gLite JP PS, please create or update the configuration + echo files /opt/glite/etc/config/glite-jpps.cfg.xml + echo and /opt/glite/etc/config/glite-global.cfg.xml + echo and run the configuration script + echo /opt/glite/etc/config/scripts/glite-jpps-config.py. + echo A template is provided in + echo /opt/glite/etc/config/templates/glite-jpps.cfg.xml + echo Alternatively site configuration files can be used + else + echo + echo An error occurred while installing the JP PS RPMS. + echo Most likely one or more of the RPMS to be installed require + echo additional dependencies or are older than already installed packages. + echo Please refer to the rpm error message above for more details. + fi + echo + echo For more information refer to the gLite Installation and User Guides + echo or to the gLite web site \(http:\/\/www.glite.org\) + echo Please report problems and comments to the gLite Team at + echo glite-bugs@cern.ch + + cd .. +} + +############################################################################### +function uninstall() +{ + version + + # Global dependencies + + + false + + + + + + # dependencies RPMS from repository + + + false + + + + # RPMS from repository + + + false + + + + + + # Uninstall all RPMS + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo x Please wait, uninstalling the gLite Job Provenance Primary Storage... x + echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx + echo + rpm -ev $RPMLIST + if [ "$?" == "0" ]; then + echo + echo Done! + else + echo + echo An error occurred while removing the JP PS RPMS. + echo Most likely one or more of the RPMS to be removed have + echo dependent packages. + echo Please refer to the rpm error message above for more details. + fi +} + +############################################################################### +function usage() +{ + echo + echo Copyright \(c\) Members of the EGEE Collaboration. 2004 + echo See http://eu-egee.org/partners/ for details on the copyright holders + echo For license conditions see the license file or http://eu-egee.org/license.html + echo + echo glite-jpps_installer v. + echo + echo The glite-jpps_installer installs the gLite Job Provenance Primary Storage + echo + echo Usage: glite-jpps_installer \[-u\|-v\|--help\] + echo -u uninstall + echo -v print version + echo --help print script usage info + echo + echo Return codes: + echo 0 - Ok + echo 1 - if a file could not be downloaded + echo +} + +############################################################################### +function version +{ + echo + echo Copyright \(c\) Members of the EGEE Collaboration. 2004 + echo See http://eu-egee.org/partners/ for details on the copyright holders + echo For license conditions see the license file or http://eu-egee.org/license.html + echo + echo glite-jpps_installer v. + echo +} + + +RPMLIST= + +############################################################################### +# Main + +while getopts uvh opt +do + case $opt in + 'u') uninstall + exit 0 + ;; + 'v') version + exit 0 + ;; + 'h') usage + exit 0 + ;; + esac +done + +install + +exit 0 + + + + + _installer.sh + + +wget -N -nv +if [ ! -f "" ] +then + echo + echo ERROR: could not be downloaded! + exit 1 +fi +chmod u+x +SCRIPTLIST="$SCRIPTLIST ./" + + +SCRIPTLISTUn="$SCRIPTLISTUn ./ -u " + + + + + + + + --..rpm + -- + + +wget -N -nv +if [ ! -f "" ] +then + echo + echo ERROR: could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST " + + +RPMLIST="$RPMLIST " + + + + + + + --..rpm + -- + + +wget -N -nv /RPMS/ +if [ ! -f "" ] +then + echo + echo ERROR: could not be downloaded! + exit 1 +fi +RPMLIST="$RPMLIST " + + +RPMLIST="$RPMLIST " + + + + + diff --git a/org.glite.deployment.jpps/project/lxscript-tgz.xsl b/org.glite.deployment.jpps/project/lxscript-tgz.xsl new file mode 100644 index 0000000..4589cf6 --- /dev/null +++ b/org.glite.deployment.jpps/project/lxscript-tgz.xsl @@ -0,0 +1,62 @@ + + + + + + + + + + + + +#!/bin/sh +# +# glite-jpps_tgz_installer +# usage: glite-jpps_tgz_installer [-u] +# -u uninstall +# +# glite-jpps_tgz_installer installs the gLite Deployment Unit from biniary tarballs +# + +PREFIX=/opt/glite + +############################################################################### +# Download global dependencies + + + +############################################################################### + + +############################################################################### +# Download dependencies RPMS from repository + + + +############################################################################### +# Download RPMS from repository + + + +############################################################################### + + + + + + --..rpm +wget + + + + -_bin.tar.gz +wget i386/tgz/ +tar -xzf $PREFIX + + + diff --git a/org.glite.deployment.jpps/project/properties.xml b/org.glite.deployment.jpps/project/properties.xml new file mode 100644 index 0000000..57a76ec --- /dev/null +++ b/org.glite.deployment.jpps/project/properties.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.glite.deployment.jpps/project/quattor-template.xsl b/org.glite.deployment.jpps/project/quattor-template.xsl new file mode 100644 index 0000000..d4dc67b --- /dev/null +++ b/org.glite.deployment.jpps/project/quattor-template.xsl @@ -0,0 +1,64 @@ + + + + + + + + + + +template pro_software_glite_jpps; + +# +# Copyright (c) Members of the EGEE Collaboration. 2004 +# See http://eu-egee.org/partners/ for details on the copyright holders +# For license conditions see the license file or http://eu-egee.org/license.html +# +# glite-jpps Quattor template v. +# + +## CAs + +include pro_software_glite_CA; + + + +# Global dependencies + + + + + + +# dependencies + + + + +# RPMS + + + + + +include pro_software_; + + + + + + + +"/software/packages"=pkg_repl("","-",""); + + + +"/software/packages"=pkg_repl("","-",""); + + + diff --git a/org.glite.deployment.jpps/project/spec.xsl b/org.glite.deployment.jpps/project/spec.xsl new file mode 100644 index 0000000..11ab7bc --- /dev/null +++ b/org.glite.deployment.jpps/project/spec.xsl @@ -0,0 +1,63 @@ + + + + + +Summary: gLite Job Provenance Primary Storage node configuration files +Name: glite-jpps-config +Version: @MODULE.VERSION@ +Release: @MODULE.BUILD@ +Copyright:Open Source EGEE License +Vendor:EU EGEE project +Group:System/Application +Prefix:/opt/glite +BuildArch: noarch +BuildRoot:%{_builddir}/%{name}-%{version} + + +Requires: + + + +Requires:-config + + + +Requires: + +Obsoletes:glite-security-voms +Source: glite-jpps.tar.gz +%define debug_package %{nil} + +%description +gLite Job Provenance Primary Storage node configuration files + +%prep + +%setup -c + +%build + +%install + +%clean + +%pre + +%post + +%preun + +%postun + +%files + %attr(755,root,root) %{prefix}/etc/config/scripts/glite-jpps-config.py\n %attr(644,root,root) %{prefix}/etc/config/templates/glite-jpps.cfg.xml\n %attr(644,root,root) %{prefix}/share/doc/glite-jpps/release_notes/release_notes.doc\n %attr(644,root,root) %{prefix}/share/doc/glite-jpps/release_notes/release_notes.pdf\n %attr(644,root,root) %{prefix}/share/doc/glite-jpps/release_notes/release_notes.html\n + +%changelog + + + diff --git a/org.glite.deployment.jpps/project/version.properties b/org.glite.deployment.jpps/project/version.properties new file mode 100644 index 0000000..b6ff6e2 --- /dev/null +++ b/org.glite.deployment.jpps/project/version.properties @@ -0,0 +1,4 @@ + +module.version = 2.2.0 +module.age = 1 + \ No newline at end of file -- 1.8.2.3