From 88232db61d6eeeeb37e30d55657f43c0ce96bd3b Mon Sep 17 00:00:00 2001 From: Maria Alandes Pradillo Date: Fri, 8 Feb 2008 12:34:50 +0000 Subject: [PATCH] Pilot yaim myproxy to test dynamic info provider by Stephen Burke. --- .../config/functions/config_info_service_px | 94 ++++++++++++++++++++++ org.glite.yaim.myproxy/config/node-info.d/glite-px | 2 +- org.glite.yaim.myproxy/glite-yaim-myproxy.spec | 4 +- 3 files changed, 97 insertions(+), 3 deletions(-) create mode 100644 org.glite.yaim.myproxy/config/functions/config_info_service_px diff --git a/org.glite.yaim.myproxy/config/functions/config_info_service_px b/org.glite.yaim.myproxy/config/functions/config_info_service_px new file mode 100644 index 0000000..5115e20 --- /dev/null +++ b/org.glite.yaim.myproxy/config/functions/config_info_service_px @@ -0,0 +1,94 @@ +############################################################################## +# Copyright (c) Members of the EGEE Collaboration. 2004. +# See http://www.eu-egee.org/partners/ for details on the copyright +# holders. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +############################################################################## +# +# NAME : config_info_service_px +# +# DESCRIPTION : This function configures the dynamic service publisher +# for MyProxy (PX) node. +# +# AUTHORS : Maria.Alandes.Pradillo@cern.ch +# +# NOTES : +# +# YAIM MODULE: glite-yaim-myproxy +# +############################################################################## + +config_info_service_px_check () { + requires $1 GRID_TRUSTED_BROKERS SITE_NAME INSTALL_ROOT +} + +config_info_service_px_setenv () { + yaimlog DEBUG "This function currently doesn't set any environment variables." +} + +config_info_service_px () { + +INFO_SERVICE_SCRIPT=${INFO_SERVICE_SCRIPT:-${INSTALL_ROOT}/glite/libexec} +INFO_SERVICE_CONFIG=${INFO_SERVICE_CONFIG:-${INSTALL_ROOT}/glite/etc} +INFO_PROVIDER_PATH=${INFO_PROVIDER_PATH:-${INSTALL_ROOT}/glite/etc/gip/provider} +SERVICE=myproxy + +rm -rf ${INFO_SERVICE_CONFIG_FILE} + +if [ ! -f ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE}.conf.template ]; then + yaimlog ERROR "The template file for glite-info-service-${SERVICE}.conf.template was not found in ${INFO_SERVICE_CONFIG}." + exit 1 +fi + +if [ ! -f ${INFO_SERVICE_SCRIPT}/glite-info-service ]; then + yaimlog ERROR "The script file for glite-info-service was not found in ${INFO_SERVICE_SCRIPT}." + exit 1 +fi + +rm -rf ${INFO_SERVICE_CONFIG_FILE} + +grid_trusted_brokers="" +while read x; do + grid_trusted_brokers="${x}\\\n${grid_trusted_brokers}" +done < <(split_quoted_variable $GRID_TRUSTED_BROKERS) + +cat ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE}.conf.template | sed \ + -e "s#^get_acbr =.*#get_acbr = echo -e \"${grid_trusted_brokers}\"#" \ +> ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE}.conf + +grep -q glite-info-service-${SERVICE}.conf ${INFO_PROVIDER_PATH}/glite-info-provider-service-wrapper >> /dev/null +res=$? +if [ -f ${INFO_PROVIDER_PATH}/glite-info-provider-service-wrapper ]; then + if [ $res -eq 1 ]; then + cat << EOF > ${INFO_PROVIDER_PATH}/glite-info-provider-service-wrapper +#!/bin/sh +export PATH=$PATH:${INFO_SERVICE_SCRIPT} +${INFO_SERVICE_SCRIPT}/glite-info-service ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE}.conf $SITE_NAME +EOF + chmod +x ${INFO_PROVIDER_PATH}/glite-info-provider-service-wrapper + fi +else + cat << EOF > ${INFO_PROVIDER_PATH}/glite-info-provider-service-wrapper +#!/bin/sh +export PATH=$PATH:${INFO_SERVICE_SCRIPT} +${INFO_SERVICE_SCRIPT}/glite-info-service ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE}.conf $SITE_NAME +EOF + chmod +x ${INFO_PROVIDER_PATH}/glite-info-provider-service-wrapper +fi + + +# Exit with success +return 0 + +} diff --git a/org.glite.yaim.myproxy/config/node-info.d/glite-px b/org.glite.yaim.myproxy/config/node-info.d/glite-px index 594bee1..b00c291 100644 --- a/org.glite.yaim.myproxy/config/node-info.d/glite-px +++ b/org.glite.yaim.myproxy/config/node-info.d/glite-px @@ -34,10 +34,10 @@ config_crl config_host_certs config_edgusers config_gip_only -config_gip_px config_globus_clients config_proxy_server config_bdii_only +config_info_service_px " diff --git a/org.glite.yaim.myproxy/glite-yaim-myproxy.spec b/org.glite.yaim.myproxy/glite-yaim-myproxy.spec index e9112bc..bbd2bb9 100644 --- a/org.glite.yaim.myproxy/glite-yaim-myproxy.spec +++ b/org.glite.yaim.myproxy/glite-yaim-myproxy.spec @@ -1,6 +1,6 @@ %define topdir %(pwd)/rpmbuild %define _topdir %{topdir} -Summary: glite-yaim-myproxy module configures 3.0 myproxy server. +Summary: This is a pilot rpm to test the new dynamic info provider for myproxy. Please, do not use it in production! Name: glite-yaim-myproxy Version: x Vendor: EGEE @@ -15,7 +15,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Packager: EGEE %description -This package contains the yaim functions necessary to configure 3.0 myproxy server. +This is a pilot rpm to test the new dynamic info provider for myproxy. Please, do not use it in production! %prep -- 1.8.2.3