From 2168f5f7a810dc9de199c69c5b2ad6d4dfd60646 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Fri, 11 Mar 2011 11:22:11 +0000 Subject: [PATCH] Try to set-up BDII. --- org.glite.px.myproxy-yaim/Makefile | 19 ++--- .../config/functions/emi/config_info_service_px | 92 ++++++++++++++++++++++ .../config/node-info.d/emi/glite-px | 4 +- 3 files changed, 101 insertions(+), 14 deletions(-) create mode 100644 org.glite.px.myproxy-yaim/config/functions/emi/config_info_service_px diff --git a/org.glite.px.myproxy-yaim/Makefile b/org.glite.px.myproxy-yaim/Makefile index 78599ae..be4deb7 100644 --- a/org.glite.px.myproxy-yaim/Makefile +++ b/org.glite.px.myproxy-yaim/Makefile @@ -10,17 +10,13 @@ sysconfdir=/opt/glite/etc -include ../project/version.properties yaim_prefix=/opt/glite -node_info=${top_srcdir}/config/node-info.d/glite-px -node_info_project=${top_srcdir}/config/node-info.d/${project}/glite-px +ifeq (${project},emi) +yaim_project=/emi +endif -FILES=glite-px.pre glite-px +FILES=glite-px.pre LICENSE COPYRIGHT node-version arch service update all ${FILES}: - if test -f "${node_info_project}"; then \ - cp ${node_info_project} . ; \ - else \ - cp ${node_info} . ; \ - fi glite_var="${localstatedir}/glite"; \ if echo "${localstatedir}" | grep 'glite'>/dev/null; then \ glite_var="${localstatedir}"; \ @@ -42,10 +38,11 @@ install: ${FILES} mkdir -p ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/etc/versions mkdir -p ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/defaults install -m 0644 $(top_srcdir)/config/services/glite-px ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/examples/siteinfo/services/glite-px - for c in gip_px info_service_px proxy_server ; do \ + for c in gip_px proxy_server ; do \ install -m 0644 $(top_srcdir)/config/functions/config_$$c ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/functions; \ done - install -m 0644 glite-px ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/node-info.d; \ + install -m 0644 $(top_srcdir)/config/functions${yaim_project}/config_info_service_px ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/functions + install -m 0644 ${top_srcdir}/config/node-info.d${yaim_project}/glite-px ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/node-info.d; \ install -m 0644 glite-px.pre ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/defaults echo "$(package) $(module.version)-$(module.age)" > ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/etc/versions/$(package) mkdir -p ${DESTDIR}${PREFIX}${yaim_prefix}/release/glite-PX @@ -59,4 +56,4 @@ check: clean: rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/ debian/ ${FILES} -.PHONY: default all check stage clean +.PHONY: default all check install stage clean diff --git a/org.glite.px.myproxy-yaim/config/functions/emi/config_info_service_px b/org.glite.px.myproxy-yaim/config/functions/emi/config_info_service_px new file mode 100644 index 0000000..826a3e9 --- /dev/null +++ b/org.glite.px.myproxy-yaim/config/functions/emi/config_info_service_px @@ -0,0 +1,92 @@ +############################################################################## +# 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 SITE_NAME INSTALL_ROOT PX_HOST +} + +config_info_service_px_setenv () { + yaimlog DEBUG "This function currently doesn't set any environment variables." +} + +config_info_service_px () { + +INFO_SERVICE_CONFIG='/etc/glite/info/service' +INFO_SERVICE_SCRIPT='/usr/bin' +INFO_PROVIDER_PATH='/var/run/bdii/gip/provider' + +SERVICE=MYPROXY +SERVICE_HOST=${PX_HOST} + +SERVICE_LC=`echo ${SERVICE} | tr '[:upper:]' '[:lower:]'` + +if [ ! -x ${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 +if [ ! -x ${INFO_SERVICE_SCRIPT}/glite-info-service-glue2 ]; then + yaimlog ERROR "The script file for glite-info-service-glue2 was not found in ${INFO_SERVICE_SCRIPT}." + exit 1 +fi + +yaimlog DEBUG "Delete a previous version of the *.conf if it exists" +rm -rf ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE_LC}.conf + +yaimlog DEBUG "Create the glite-info-service-${SERVICE_LC}.conf file out of the template file" +cp ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE_LC}.conf.template ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE_LC}.conf +if [ $? != 0 ]; then + yaimlog ERROR "Copying service template failed" + exit 1 +fi + +# Note: the configuration file may need to be altered if non standard values have been used. + +yaimlog DEBUG "Delete a previous version of the glite-info-provider-service-${SERVICE_LC}-wrapper if it exists" +rm -rf ${INFO_PROVIDER_PATH}/glite-info-provider-service-${SERVICE_LC}-wrapper + +yaimlog DEBUG "Create the ${INFO_PROVIDER_PATH} in case it doesn't exist" +mkdir -p ${INFO_PROVIDER_PATH} + +yaimlog DEBUG "Create the glite-info-provider-service-${SERVICE_LC}-wrapper file" +cat << EOF > ${INFO_PROVIDER_PATH}/glite-info-provider-service-${SERVICE_LC}-wrapper +#!/bin/sh +export PATH=$PATH:${INFO_SERVICE_SCRIPT} +export ${SERVICE}_HOST=${SERVICE_HOST} +${INFO_SERVICE_SCRIPT}/glite-info-service ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE_LC}.conf $SITE_NAME +${INFO_SERVICE_SCRIPT}/glite-info-service-glue2 ${INFO_SERVICE_CONFIG}/glite-info-service-${SERVICE_LC}.conf $SITE_NAME +EOF + +chmod +x ${INFO_PROVIDER_PATH}/glite-info-provider-service-${SERVICE_LC}-wrapper + + +return 0 + +} diff --git a/org.glite.px.myproxy-yaim/config/node-info.d/emi/glite-px b/org.glite.px.myproxy-yaim/config/node-info.d/emi/glite-px index bc39e2e..7b2298d 100644 --- a/org.glite.px.myproxy-yaim/config/node-info.d/emi/glite-px +++ b/org.glite.px.myproxy-yaim/config/node-info.d/emi/glite-px @@ -33,11 +33,9 @@ PX_FUNCTIONS=" config_crl config_host_certs config_edgusers -config_gip_only -config_gip_px config_gip_service_release config_proxy_server -config_bdii_5.1 +config_bdii_5.2 config_info_service_px " -- 1.8.2.3