From 3e3250e02ca543f075f01d67f9975a31909fa9ae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Wed, 2 Mar 2011 20:04:30 +0000 Subject: [PATCH] Finalize deployment changes for EMI (some dirty hacks and exceptions could be removed): - distinguish yaim prefix and glite prefix - /var directory location - product-specific GLITE_*_LOCATION* variables - project-specific yaim functions list file - update startup scripts --- org.glite.lb.harvester/config/startup | 19 ++++---- org.glite.lb.logger/config/startup | 20 ++++---- org.glite.lb.server/config/startup | 54 +++++++++++----------- org.glite.lb.yaim/Makefile | 46 ++++++++++-------- org.glite.lb.yaim/config/defaults/glite-lb.pre | 8 ++-- org.glite.lb.yaim/config/functions/config_glite_lb | 54 +++++++++++----------- org.glite.lb.yaim/config/node-info.d/emi/glite-lb | 13 ++++++ org.glite.lb/configure | 16 ++++--- org.glite.px.myproxy-yaim/Makefile | 52 ++++++++++++--------- .../config/defaults/glite-px.pre | 3 ++ .../config/defaults/glite-px.pre.sh | 4 -- .../config/functions/config_proxy_server | 4 +- .../config/node-info.d/emi/glite-px | 44 ++++++++++++++++++ org.glite.px.proxyrenewal/config/startup | 10 ++-- 14 files changed, 213 insertions(+), 134 deletions(-) create mode 100644 org.glite.lb.yaim/config/node-info.d/emi/glite-lb create mode 100644 org.glite.px.myproxy-yaim/config/defaults/glite-px.pre delete mode 100755 org.glite.px.myproxy-yaim/config/defaults/glite-px.pre.sh create mode 100644 org.glite.px.myproxy-yaim/config/node-info.d/emi/glite-px diff --git a/org.glite.lb.harvester/config/startup b/org.glite.lb.harvester/config/startup index 603568d..6a125fe 100755 --- a/org.glite.lb.harvester/config/startup +++ b/org.glite.lb.harvester/config/startup @@ -17,23 +17,24 @@ # limitations under the License. # -GLITE_LOCATION=${GLITE_LOCATION:-/opt/glite} -GLITE_LOCATION_VAR=${GLITE_LOCATION_VAR:-/var/glite} +GLITE_LB_LOCATION=${GLITE_LB_LOCATION:-/opt/glite} +GLITE_LB_LOCATION_ETC=${GLITE_LB_LOCATION_ETC:-/opt/glite/etc} +GLITE_LB_LOCATION_VAR=${GLITE_LB_LOCATION_VAR:-/var/glite} [ -f /etc/glite.conf ] && . /etc/glite.conf -[ -f $GLITE_LOCATION/etc/glite-wms.conf ] && . $GLITE_LOCATION/etc/glite-wms.conf +[ -f $GLITE_LB_LOCATION_ETC/glite-wms.conf ] && . $GLITE_LB_LOCATION_ETC/glite-wms.conf -[ -f $GLITE_LOCATION/etc/lb.conf ] && . $GLITE_LOCATION/etc/lb.conf -[ -f $GLITE_LOCATION_VAR/etc/lb.conf ] && . $GLITE_LOCATION_VAR/etc/lb.conf +[ -f $GLITE_LB_LOCATION/lb.conf ] && . $GLITE_LB_LOCATION_ETC/lb.conf +[ -f $GLITE_LB_LOCATION_VAR/etc/lb.conf ] && . $GLITE_LB_LOCATION_VAR/etc/lb.conf [ -f $HOME/.glite.conf ] && . $HOME/.glite.conf -pidfile=${GLITE_LB_HARVESTER_PIDFILE:-"$GLITE_LOCATION_VAR/glite-lb-harvester.pid"} +pidfile=${GLITE_LB_HARVESTER_PIDFILE:-"$GLITE_LB_LOCATION_VAR/glite-lb-harvester.pid"} level=${GLITE_LB_HARVESTER_DEBUG_LEVEL:-"1"} # database or configuration file needed # (using the file as default) -etc=$GLITE_LOCATION/etc/glite-lb +etc=$GLITE_LB_LOCATION/glite-lb [ -z "$GLITE_LB_HARVESTER_DBCS" -a -z "$GLITE_LB_HARVESTER_CONFIG" ] && GLITE_LB_HARVESTER_CONFIG=$etc/harvester.conf if [ -n "$GLITE_LB_HARVESTER_CONFIG" ]; then [ ! -d "$etc" ] && mkdir -p "$etc" @@ -144,13 +145,13 @@ start() return 1 fi - log4c="LOG4C_RCPATH='$GLITE_LOCATION/etc/glite-lb'" + log4c="LOG4C_RCPATH='$GLITE_LB_LOCATION_ETC/glite-lb'" [ -z "$creds" ] && echo $0: WARNING: No credentials specified. Using default lookup which is dangerous. >&2 [ -n "$GLITE_LB_HARVESTER_PORT" ] && port="-p $GLITE_LB_HARVESTER_PORT" - start_daemon glite-lb-harvester "$pidfile" "$GLITE_LOCATION/bin/glite-lb-harvester \ + start_daemon glite-lb-harvester "$pidfile" "$GLITE_LB_LOCATION/bin/glite-lb-harvester \ $creds $conf -i $pidfile -d $level $port --daemon\ $GLITE_LB_HARVESTER_OTHER_OPTIONS" "$HARVESTER_NOTIFSFILE" } diff --git a/org.glite.lb.logger/config/startup b/org.glite.lb.logger/config/startup index 7a70366..7a80c96 100755 --- a/org.glite.lb.logger/config/startup +++ b/org.glite.lb.logger/config/startup @@ -17,19 +17,19 @@ # limitations under the License. # -GLITE_LOCATION=${GLITE_LOCATION:-/opt/glite} -GLITE_LOCATION_VAR=${GLITE_LOCATION_VAR:-$GLITE_LOCATION/var} +GLITE_LB_LOCATION=${GLITE_LB_LOCATION:-/opt/glite} +GLITE_LB_LOCATION_VAR=${GLITE_LB_LOCATION_VAR:-$GLITE_LB_LOCATION/var} [ -f /etc/glite.conf ] && . /etc/glite.conf -[ -f $GLITE_LOCATION/etc/glite-wms.conf ] && . $GLITE_LOCATION/etc/glite-wms.conf +[ -f $GLITE_LB_LOCATION_ETC/glite-wms.conf ] && . $GLITE_LB_LOCATION_ETC/glite-wms.conf -[ -f $GLITE_LOCATION/etc/lb.conf ] && . $GLITE_LOCATION/etc/lb.conf -[ -f $GLITE_LOCATION_VAR/etc/lb.conf ] && . $GLITE_LOCATION_VAR/etc/lb.conf +[ -f $GLITE_LB_LOCATION_ETC/lb.conf ] && . $GLITE_LB_LOCATION_ETC/lb.conf +[ -f $GLITE_LB_LOCATION_VAR/etc/lb.conf ] && . $GLITE_LB_LOCATION_VAR/etc/lb.conf [ -f $HOME/.glite.conf ] && . $HOME/.glite.conf -LL_PIDFILE=${LL_PIDFILE:-$GLITE_LOCATION_VAR/glite-lb-logd.pid} -IL_PIDFILE=${IL_PIDFILE:-$GLITE_LOCATION_VAR/glite-lb-interlogd.pid} +LL_PIDFILE=${LL_PIDFILE:-$GLITE_LB_LOCATION_VAR/glite-lb-logd.pid} +IL_PIDFILE=${IL_PIDFILE:-$GLITE_LB_LOCATION_VAR/glite-lb-interlogd.pid} IL_SOCKFILE=/tmp/interlogger.sock unset creds port log4c @@ -117,15 +117,15 @@ start() [ -n "$GLITE_LB_IL_SOCK" ] && sock="--socket $GLITE_LB_IL_SOCK" [ -n "$GLITE_LB_IL_FPREFIX" ] && fprefix="--file-prefix $GLITE_LB_IL_FPREFIX" - log4c="LOG4C_RCPATH='$GLITE_LOCATION/etc/glite-lb'" + log4c="LOG4C_RCPATH='$GLITE_LB_LOCATION_ETC/glite-lb'" mkdir -p /var/glite/log chown $GLITE_USER /var/glite/log (cd /tmp && ls -f /tmp |grep ^dglogd_sock_ |xargs rm -f) - start_daemon "glite-lb-logd" "$LL_PIDFILE" "$GLITE_LOCATION/bin/glite-lb-logd \ + start_daemon "glite-lb-logd" "$LL_PIDFILE" "$GLITE_LB_LOCATION/bin/glite-lb-logd \ -i $LL_PIDFILE $creds $port $sock $fprefix" - start_daemon "glite-lb-interlogd" "$IL_PIDFILE" "$GLITE_LOCATION/bin/glite-lb-interlogd \ + start_daemon "glite-lb-interlogd" "$IL_PIDFILE" "$GLITE_LB_LOCATION/bin/glite-lb-interlogd \ -i $IL_PIDFILE $creds $sock $fprefix" "$IL_SOCKFILE" } diff --git a/org.glite.lb.server/config/startup b/org.glite.lb.server/config/startup index e1afc9f..d00e1b8 100755 --- a/org.glite.lb.server/config/startup +++ b/org.glite.lb.server/config/startup @@ -17,30 +17,30 @@ # limitations under the License. # -GLITE_LOCATION=${GLITE_LOCATION:-/opt/glite} -GLITE_LOCATION_VAR=${GLITE_LOCATION_VAR:-/var/glite} -GLITE_JP_LOCATION=${GLITE_JP_LOCATION:-$GLITE_LOCATION} +GLITE_LB_LOCATION=${GLITE_LB_LOCATION:-/opt/glite} +GLITE_LB_LOCATION_VAR=${GLITE_LB_LOCATION_VAR:-/var/glite} +GLITE_JP_LOCATION=${GLITE_JP_LOCATION:-$GLITE_LB_LOCATION} [ -f /etc/glite.conf ] && . /etc/glite.conf -[ -f $GLITE_LOCATION/etc/glite-wms.conf ] && . $GLITE_LOCATION/etc/glite-wms.conf +[ -f $GLITE_LB_LOCATION_ETC/glite-wms.conf ] && . $GLITE_LB_LOCATION_ETC/glite-wms.conf -[ -f $GLITE_LOCATION/etc/lb.conf ] && . $GLITE_LOCATION/etc/lb.conf -[ -f $GLITE_LOCATION_VAR/etc/lb.conf ] && . $GLITE_LOCATION_VAR/etc/lb.conf +[ -f $GLITE_LB_LOCATION_ETC/lb.conf ] && . $GLITE_LB_LOCATION_ETC/lb.conf +[ -f $GLITE_LB_LOCATION_VAR/etc/lb.conf ] && . $GLITE_LB_LOCATION_VAR/etc/lb.conf [ -f $HOME/.glite.conf ] && . $HOME/.glite.conf [ -n "$GLITE_LB_SERVER_PIDFILE" ] && BK_PIDFILE=$GLITE_LB_SERVER_PIDFILE || - BK_PIDFILE=$GLITE_LOCATION_VAR/glite-lb-bkserverd.pid + BK_PIDFILE=$GLITE_LB_LOCATION_VAR/glite-lb-bkserverd.pid [ -z "$GLITE_LB_NOTIF_SOCK" ] && GLITE_LB_NOTIF_SOCK="/tmp/glite-lb-notif.sock" [ -n "$GLITE_JP_IMPORTER_PIDFILE" ] && jp_importer_pidfile=$GLITE_JP_IMPORTER_PIDFILE || - jp_importer_pidfile=$GLITE_LOCATION_VAR/glite-jp-importer.pid + jp_importer_pidfile=$GLITE_LB_LOCATION_VAR/glite-jp-importer.pid GLITE_LB_TYPE=${GLITE_LB_TYPE:-'server'} # server, proxy, both GLITE_LB_PROXY_SOCK=${GLITE_LB_PROXY_SOCK:-'/tmp/glite-lbproxy-ilog.sock'} GLITE_LB_PROXY_FPREFIX=${GLITE_LB_PROXY_FPREFIX:-'/tmp/glite-lbproxy-ilog_events'} -PROXY_IL_PIDFILE=$GLITE_LOCATION_VAR/glite-lb-proxy-interlogd.pid -NOTIF_IL_PIDFILE=$GLITE_LOCATION_VAR/glite-lb-notif-interlogd.pid +PROXY_IL_PIDFILE=$GLITE_LB_LOCATION_VAR/glite-lb-proxy-interlogd.pid +NOTIF_IL_PIDFILE=$GLITE_LB_LOCATION_VAR/glite-lb-notif-interlogd.pid unset creds port log4c @@ -140,10 +140,10 @@ start() fi fi - log4c="LOG4C_RCPATH='$GLITE_LOCATION/etc/glite-lb'" + log4c="LOG4C_RCPATH='$GLITE_LB_LOCATION_ETC/glite-lb'" - policy="$GLITE_LOCATION/etc/glite-lb/glite-lb-authz.conf" - lcas_log="LCAS_LOG_FILE='/var/log/glite/glite-lb-lcas.log' LCAS_ETC_DIR='/opt/glite/etc/glite-lb'" + policy="$GLITE_LB_LOCATION_ETC/glite-lb/glite-lb-authz.conf" + lcas_log="LCAS_LOG_FILE='/var/log/glite/glite-lb-lcas.log' LCAS_ETC_DIR='$GLITE_LB_LOCATION_ETC/glite-lb'" if test -f "$policy"; then # lcas not enabled by default yet policy="--policy '$policy'" @@ -152,11 +152,11 @@ start() unset lcas_log fi - [ -z "$GLITE_LB_EXPORT_DUMPDIR" ] && GLITE_LB_EXPORT_DUMPDIR=$GLITE_LOCATION_VAR/dump + [ -z "$GLITE_LB_EXPORT_DUMPDIR" ] && GLITE_LB_EXPORT_DUMPDIR=$GLITE_LB_LOCATION_VAR/dump dumpdir="--dump-prefix $GLITE_LB_EXPORT_DUMPDIR" [ -d "$GLITE_LB_EXPORT_DUMPDIR" ] || mkdir -p "$GLITE_LB_EXPORT_DUMPDIR" && chown $GLITE_USER:$GLITE_GROUP -R "$GLITE_LB_EXPORT_DUMPDIR" - [ -z "$GLITE_LB_EXPORT_PURGEDIR" ] && GLITE_LB_EXPORT_PURGEDIR=$GLITE_LOCATION_VAR/purge + [ -z "$GLITE_LB_EXPORT_PURGEDIR" ] && GLITE_LB_EXPORT_PURGEDIR=$GLITE_LB_LOCATION_VAR/purge purgedir="--purge-prefix $GLITE_LB_EXPORT_PURGEDIR" [ -d "$GLITE_LB_EXPORT_PURGEDIR" ] || mkdir -p "$GLITE_LB_EXPORT_PURGEDIR" && chown $GLITE_USER:$GLITE_GROUP -R "$GLITE_LB_EXPORT_PURGEDIR" @@ -167,18 +167,18 @@ start() fi # registrations - [ -z "$GLITE_LB_EXPORT_JPREG_MAILDIR" ] && GLITE_LB_EXPORT_JPREG_MAILDIR=$GLITE_LOCATION_VAR/jpreg + [ -z "$GLITE_LB_EXPORT_JPREG_MAILDIR" ] && GLITE_LB_EXPORT_JPREG_MAILDIR=$GLITE_LB_LOCATION_VAR/jpreg jpreg_maildir="--reg-mdir $GLITE_LB_EXPORT_JPREG_MAILDIR" lbreg_maildir="--jpreg-dir $GLITE_LB_EXPORT_JPREG_MAILDIR" [ -d "$GLITE_LB_EXPORT_JPREG_MAILDIR" ] || mkdir -p "$GLITE_LB_EXPORT_JPREG_MAILDIR" && chown $GLITE_USER:$GLITE_GROUP -R "$GLITE_LB_EXPORT_JPREG_MAILDIR" # dumps - [ -z "$GLITE_LB_EXPORT_JPDUMP_MAILDIR" ] && GLITE_LB_EXPORT_JPDUMP_MAILDIR=$GLITE_LOCATION_VAR/jpdump + [ -z "$GLITE_LB_EXPORT_JPDUMP_MAILDIR" ] && GLITE_LB_EXPORT_JPDUMP_MAILDIR=$GLITE_LB_LOCATION_VAR/jpdump jpdump_maildir="--dump-mdir $GLITE_LB_EXPORT_JPDUMP_MAILDIR" [ -d "$GLITE_LB_EXPORT_JPDUMP_MAILDIR" ] || mkdir -p "$GLITE_LB_EXPORT_JPDUMP_MAILDIR" && chown $GLITE_USER:$GLITE_GROUP -R "$GLITE_LB_EXPORT_JPDUMP_MAILDIR" # sandboxes - [ -z "$GLITE_LB_EXPORT_SANDBOX_MAILDIR" ] && GLITE_LB_EXPORT_SANDBOX_MAILDIR=$GLITE_LOCATION_VAR/sandbox + [ -z "$GLITE_LB_EXPORT_SANDBOX_MAILDIR" ] && GLITE_LB_EXPORT_SANDBOX_MAILDIR=$GLITE_LB_LOCATION_VAR/sandbox sandbox_maildir="--sandbox-mdir $GLITE_LB_EXPORT_SANDBOX_MAILDIR" [ -d "$GLITE_LB_EXPORT_SANDBOX_MAILDIR" ] || mkdir -p "$GLITE_LB_EXPORT_SANDBOX_MAILDIR" && chown $GLITE_USER:$GLITE_GROUP -R "$GLITE_LB_EXPORT_SANDBOX_MAILDIR" @@ -193,11 +193,11 @@ start() [ -z "$GLITE_LB_NOTIF_FPREFIX" ] && GLITE_LB_NOTIF_FPREFIX="/var/tmp/glite-lb-notif" if [ -n "$GLITE_LB_SERVER_DEBUG" ] ; then if which tscat >/dev/null; then - GLITE_LB_SERVER_OTHER_OPTIONS="$GLITE_LB_SERVER_OTHER_OPTIONS -d -s 1 2>&1 | tscat >> $GLITE_LOCATION_VAR/lb.log &" - GLITE_LB_NOTIF_OTHER_OPTIONS="$GLITE_LB_NOTIF_OTHER_OPTIONS -v -d 2>&1 | tscat >> $GLITE_LOCATION_VAR/notif-il.log &" + GLITE_LB_SERVER_OTHER_OPTIONS="$GLITE_LB_SERVER_OTHER_OPTIONS -d -s 1 2>&1 | tscat >> $GLITE_LB_LOCATION_VAR/lb.log &" + GLITE_LB_NOTIF_OTHER_OPTIONS="$GLITE_LB_NOTIF_OTHER_OPTIONS -v -d 2>&1 | tscat >> $GLITE_LB_LOCATION_VAR/notif-il.log &" else - GLITE_LB_SERVER_OTHER_OPTIONS="$GLITE_LB_SERVER_OTHER_OPTIONS -d -s 1 >> $GLITE_LOCATION_VAR/lb.log 2>&1 &" - GLITE_LB_NOTIF_OTHER_OPTIONS="$GLITE_LB_NOTIF_OTHER_OPTIONS -v -d >> $GLITE_LOCATION_VAR/notif-il.log 2>&1 &" + GLITE_LB_SERVER_OTHER_OPTIONS="$GLITE_LB_SERVER_OTHER_OPTIONS -d -s 1 >> $GLITE_LB_LOCATION_VAR/lb.log 2>&1 &" + GLITE_LB_NOTIF_OTHER_OPTIONS="$GLITE_LB_NOTIF_OTHER_OPTIONS -v -d >> $GLITE_LB_LOCATION_VAR/notif-il.log 2>&1 &" fi fi case "$GLITE_LB_TYPE" in @@ -212,14 +212,14 @@ start() ;; esac - start_daemon glite-lb-bkserver "$BK_PIDFILE" "$lcas_log $GLITE_LOCATION/bin/glite-lb-bkserverd \ + start_daemon glite-lb-bkserver "$BK_PIDFILE" "$lcas_log $GLITE_LB_LOCATION/bin/glite-lb-bkserverd \ --notif-il-sock=$GLITE_LB_NOTIF_SOCK \ --notif-il-fprefix=$GLITE_LB_NOTIF_FPREFIX \ $super $creds -i $BK_PIDFILE $port $wport $dumpdir $purgedir $lbreg_maildir $proxy $policy\ $GLITE_LB_SERVER_OTHER_OPTIONS" "/tmp/lb_proxy_serve.sock /tmp/lb_proxy_store.sock" - if test -x $GLITE_LOCATION/bin/glite-lb-notif-interlogd; then - start_daemon glite-lb-notif-interlogd "$NOTIF_IL_PIDFILE" "$GLITE_LOCATION/bin/glite-lb-notif-interlogd \ + if test -x $GLITE_LB_LOCATION/bin/glite-lb-notif-interlogd; then + start_daemon glite-lb-notif-interlogd "$NOTIF_IL_PIDFILE" "$GLITE_LB_LOCATION/bin/glite-lb-notif-interlogd \ -f $GLITE_LB_NOTIF_FPREFIX -s $GLITE_LB_NOTIF_SOCK \ -i $NOTIF_IL_PIDFILE -M 10485760 \ $creds $GLITE_LB_NOTIF_IL_OTHER_OPTIONS" "$GLITE_LB_NOTIF_SOCK" @@ -236,8 +236,8 @@ start() fi if test x"$GLITE_LB_TYPE" = x"proxy" -o x"$GLITE_LB_TYPE" = x"both" ; then - if test -x $GLITE_LOCATION/bin/glite-lb-interlogd; then - start_daemon "glite-lb-interlog for proxy" "$PROXY_IL_PIDFILE" "$GLITE_LOCATION/bin/glite-lb-interlogd \ + if test -x $GLITE_LB_LOCATION/bin/glite-lb-interlogd; then + start_daemon "glite-lb-interlog for proxy" "$PROXY_IL_PIDFILE" "$GLITE_LB_LOCATION/bin/glite-lb-interlogd \ -f $GLITE_LB_PROXY_FPREFIX -s $GLITE_LB_PROXY_SOCK \ -i $PROXY_IL_PIDFILE \ $creds $GLITE_LB_PROXY_IL_OTHER_OPTIONS" "$GLITE_LB_PROXY_SOCK" diff --git a/org.glite.lb.yaim/Makefile b/org.glite.lb.yaim/Makefile index 8c83c2b..4d82346 100644 --- a/org.glite.lb.yaim/Makefile +++ b/org.glite.lb.yaim/Makefile @@ -8,25 +8,35 @@ prefix= -include Makefile.inc -include ../project/version.properties -all: - -install: - mkdir -p ${DESTDIR}${PREFIX}${prefix}/yaim/functions/ - mkdir -p ${DESTDIR}${PREFIX}${prefix}/yaim/node-info.d - mkdir -p ${DESTDIR}${PREFIX}${prefix}/yaim/defaults - mkdir -p ${DESTDIR}${PREFIX}${prefix}/yaim/etc/versions - install -m 0644 $(top_srcdir)/config/defaults/glite-lb.pre ${DESTDIR}${PREFIX}${prefix}/yaim/defaults - for c in gip_lb glite_lb info_service_lb ; do \ - install -m 0644 $(top_srcdir)/config/functions/config_$$c ${DESTDIR}${PREFIX}${prefix}/yaim/functions; \ - done - # dirty hack for EPEL - flavour-less globus not initialized by gpt - if test "x$(thrflavour)" = "x"; then \ - grep -v config_globus_clients $(top_srcdir)/config/node-info.d/glite-lb > glite-lb; \ - install -m 0644 glite-lb ${DESTDIR}${PREFIX}${prefix}/yaim/node-info.d; \ +yaim_prefix=/opt/glite +node_info=${top_srcdir}/config/node-info.d/glite-lb +node_info_project=${top_srcdir}/config/node-info.d/${project}/glite-lb + +FILES=glite-lb.pre glite-lb + +all ${FILES}: + if test -f "${node_info_project}"; then \ + cp ${node_info_project} . ; \ else \ - install -m 0644 $(top_srcdir)/config/node-info.d/glite-lb ${DESTDIR}${PREFIX}${prefix}/yaim/node-info.d; \ + cp ${node_info} . ; \ fi - echo "$(package) $(module.version)-$(module.age)" > ${DESTDIR}${PREFIX}${prefix}/yaim/etc/versions/$(package) + glite_var="${localstatedir}/glite"; \ + if echo "${localstatedir}" | grep 'glite'>/dev/null; then \ + glite_var="${localstatedir}"; \ + fi; \ + sed -e 's:@glite_prefix@:${sysroot}${prefix}:' -e 's:@glite_etc@:${sysconfdir}:' -e "s:@glite_var@:$$glite_var:" $(top_srcdir)/config/defaults/glite-lb.pre > glite-lb.pre + +install: ${FILES} + mkdir -p ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/functions/ + mkdir -p ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/node-info.d + mkdir -p ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/defaults + mkdir -p ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/etc/versions + for c in gip_lb glite_lb info_service_lb ; do \ + install -m 0644 $(top_srcdir)/config/functions/config_$$c ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/functions; \ + done + install -m 0644 glite-lb ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/node-info.d + install -m 0644 glite-lb.pre ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/defaults + echo "$(package) $(module.version)-$(module.age)" > ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/etc/versions/$(package) stage: $(MAKE) install PREFIX=${stagedir} @@ -34,6 +44,6 @@ stage: check: clean: - rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/ debian/ + rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/ debian/ ${FILES} .PHONY: default all check stage clean diff --git a/org.glite.lb.yaim/config/defaults/glite-lb.pre b/org.glite.lb.yaim/config/defaults/glite-lb.pre index 7fd270c..214486c 100644 --- a/org.glite.lb.yaim/config/defaults/glite-lb.pre +++ b/org.glite.lb.yaim/config/defaults/glite-lb.pre @@ -4,8 +4,10 @@ # system settings # -# backward compatible default location of GLITE_LOCATION_VAR -GLITE_LOCATION_VAR=/var/glite +GLITE_LB_LOCATION='@glite_prefix@' +GLITE_LB_LOCATION_ETC='@glite_etc@' +GLITE_LB_LOCATION_VAR='@glite_var@' + # query timeout GLITE_WMS_QUERY_TIMEOUT=300 # CA certificates directory @@ -23,7 +25,7 @@ GLITE_LB_EXPORT_PURGE_ARGS='--cleared 2d --aborted 15d --cancelled 15d --other 6 GLITE_LB_EXPORT_ENABLED='false' # Job Provenance server GLITE_LB_EXPORT_JPPS= -# prefix to the Job Provenance installation (if different from $GLITE_LOCATION) +# prefix to the Job Provenance installation (if different from $GLITE_LB_LOCATION) GLITE_JP_LOCATION= # diff --git a/org.glite.lb.yaim/config/functions/config_glite_lb b/org.glite.lb.yaim/config/functions/config_glite_lb index 800531d..92e4521 100644 --- a/org.glite.lb.yaim/config/functions/config_glite_lb +++ b/org.glite.lb.yaim/config/functions/config_glite_lb @@ -1,5 +1,5 @@ function config_glite_lb_check(){ - requires $1 MYSQL_PASSWORD INSTALL_ROOT GLITE_LOCATION GLITE_LOCATION_VAR GLITE_USER + requires $1 MYSQL_PASSWORD INSTALL_ROOT GLITE_LOCATION GLITE_LB_LOCATION GLITE_LB_LOCATION_ETC GLITE_LB_LOCATION_VAR GLITE_USER } # check directory existence first @@ -101,7 +101,7 @@ function config_glite_lb_authz() { superusers="`echo \"$superusers\" | tr ',' '\n' | grep -v ^$ | sed 's/\(.*\)/\trule permit {\n\t\tsubject = \"\1\"\n\t}/'`" rtm="`echo \"$rtm\" | tr ',' '\n' | grep -v ^$ | sed 's/\(.*\)/\trule permit {\n\t\tsubject = \"\1\"\n\t}/'`" - authconf="$GLITE_LOCATION/etc/glite-lb/glite-lb-authz.conf" + authconf="$GLITE_LB_LOCATION_ETC/glite-lb/glite-lb-authz.conf" cat < "$authconf".new resource "LB" { @@ -150,11 +150,11 @@ EOF fi # superusers file deprecated - if test -s "${GLITE_LOCATION}/etc/LB-super-users"; then - yaimlog WARNING "Found old superusers file '${GLITE_LOCATION}/etc/LB-super-users', check 'ADMIN_ACCESS' section in glite-lb-authz.conf" - echo "# deprecated file, replaced by ADMIN_ACCESS action in glite-lb-authz.conf" > "${GLITE_LOCATION}/etc/LB-super-users.old" - cat "${GLITE_LOCATION}/etc/LB-super-users" >> "${GLITE_LOCATION}/etc/LB-super-users.old" - rm "${GLITE_LOCATION}/etc/LB-super-users" + if test -s "${GLITE_LB_LOCATION_ETC}/LB-super-users"; then + yaimlog WARNING "Found old superusers file '${GLITE_LB_LOCATION_ETC}/LB-super-users', check 'ADMIN_ACCESS' section in glite-lb-authz.conf" + echo "# deprecated file, replaced by ADMIN_ACCESS action in glite-lb-authz.conf" > "${GLITE_LB_LOCATION_ETC}/LB-super-users.old" + cat "${GLITE_LB_LOCATION_ETC}/LB-super-users" >> "${GLITE_LB_LOCATION_ETC}/LB-super-users.old" + rm "${GLITE_LB_LOCATION_ETC}/LB-super-users" fi mv "$authconf".new "$authconf" @@ -184,9 +184,9 @@ function config_glite_lb() { return 1 fi - LB_PURGE="$GLITE_LOCATION/bin/glite-lb-purge" + LB_PURGE="$GLITE_LB_LOCATION/bin/glite-lb-purge" if [ ! -x "$LB_PURGE" ]; then - LB_PURGE="$GLITE_LOCATION/sbin/glite-lb-purge" + LB_PURGE="$GLITE_LB_LOCATION/sbin/glite-lb-purge" fi if [ ! -x "$LB_PURGE" ]; then yaimlog ABORT "Purge utility not found! Install glite-lb-utils (or glite-lb-client in older version)" @@ -240,7 +240,7 @@ function config_glite_lb() { if [ ! $? = 0 ]; then mysql -u root --password="$MYSQL_PASSWORD" -e "CREATE DATABASE lbserver20" - mysql --password="$MYSQL_PASSWORD" lbserver20 < ${GLITE_LOCATION}/etc/glite-lb/glite-lb-dbsetup.sql + mysql --password="$MYSQL_PASSWORD" lbserver20 < ${GLITE_LB_LOCATION_ETC}/glite-lb/glite-lb-dbsetup.sql mysql -u root --password="$MYSQL_PASSWORD" -e "GRANT ALL PRIVILEGES on lbserver20.* to lbserver IDENTIFIED BY '' WITH GRANT OPTION;" mysql -u root --password="$MYSQL_PASSWORD" -e "GRANT ALL PRIVILEGES on lbserver20.* to lbserver@'$HOSTNAME' IDENTIFIED BY '' WITH GRANT OPTION;" mysql -u root --password="$MYSQL_PASSWORD" -e "GRANT ALL PRIVILEGES on lbserver20.* to lbserver@localhost IDENTIFIED BY '' WITH GRANT OPTION;" @@ -256,7 +256,7 @@ function config_glite_lb() { # 1) if L&B with local harvester or L&B for Real Time Monitoring ==> lastUpdateTime needed # 2) if GLITE_LB_INDEX_OWNER specified ==> create/destroy owner index need_reindex=0 - $GLITE_LOCATION/bin/glite-lb-bkindex -d 2>/dev/null | tail -n +3 | head -n -2 | sed 's/\([^,]\)$/\1,/' > /var/tmp/glite-lb-bkindexes.txt + $GLITE_LB_LOCATION/bin/glite-lb-bkindex -d 2>/dev/null | tail -n +3 | head -n -2 | sed 's/\([^,]\)$/\1,/' > /var/tmp/glite-lb-bkindexes.txt if [ x"$GLITE_LB_RTM_ENABLED" = x"true" -o x"GLITE_LB_HARVESTER_ENABLED" = x"true" ]; then # index for querying older jobs by real time monitor grep '\[ type = "system"; name = "lastUpdateTime" \]' /var/tmp/glite-lb-bkindexes.txt >/dev/null @@ -284,7 +284,7 @@ function config_glite_lb() { fi fi if [ $need_reindex = 1 ]; then - cat << EOF | $GLITE_LOCATION/bin/glite-lb-bkindex -rv + cat << EOF | $GLITE_LB_LOCATION/bin/glite-lb-bkindex -rv [ JobIndices = { `cat /var/tmp/glite-lb-bkindexes.txt` @@ -294,10 +294,10 @@ EOF fi rm -f /var/tmp/glite-lb-bkindexes.txt - mkdir -p $GLITE_LOCATION_VAR # Needed to store PID of LB server + mkdir -p $GLITE_LB_LOCATION_VAR # Needed to store PID of LB server - chown $GLITE_USER:$GLITE_USER $GLITE_LOCATION_VAR - chmod 0755 $GLITE_LOCATION_VAR + chown $GLITE_USER:$GLITE_USER $GLITE_LB_LOCATION_VAR + chmod 0755 $GLITE_LB_LOCATION_VAR mkdir -p $GLITE_HOME_DIR/.certs chown $GLITE_USER:$GLITE_USER $GLITE_HOME_DIR/.certs @@ -322,7 +322,7 @@ EOF HOME=/ MAILTO=$SITE_EMAIL -1 1 * * * $GLITE_USER . /opt/glite/etc/profile.d/grid-env.sh ; export GLITE_LB_EXPORT_BKSERVER=$HOSTNAME; $purge_target_runtime_cmd/opt/glite/sbin/glite-lb-export.sh >> $logfile 2>&1 +1 1 * * * $GLITE_USER . $GLITE_LOCATION/etc/profile.d/grid-env.sh ; export GLITE_LB_EXPORT_BKSERVER=$HOSTNAME; $purge_target_runtime_cmd/opt/glite/sbin/glite-lb-export.sh >> $logfile 2>&1 EOF touch $logfile @@ -341,12 +341,12 @@ EOF # config file lcas_libarch=lib if [ x`uname -m` = xx86_64 ]; then - if [ -f "$GLITE_LOCATION/lib64/modules/lcas_lb.mod" ]; then + if [ -f "$GLITE_LB_LOCATION/lib64/modules/lcas_lb.mod" ]; then lcas_libarch=lib64 fi fi - lcas_plugin="$GLITE_LOCATION/$lcas_libarch/modules/lcas_lb.mod" - echo "pluginname=\"$lcas_plugin\"" > ${GLITE_LOCATION}/etc/glite-lb/lcas.db + lcas_plugin="$GLITE_LB_LOCATION/$lcas_libarch/modules/lcas_lb.mod" + echo "pluginname=\"$lcas_plugin\"" > ${GLITE_LB_LOCATION_ETC}/glite-lb/lcas.db # log file logfile=/var/log/glite/glite-lb-lcas.log touch $logfile @@ -361,13 +361,13 @@ $logfile { EOF # Start services - if [ ! -f ${GLITE_LOCATION}/etc/gLiteservices ] ; then - touch ${GLITE_LOCATION}/etc/gLiteservices + if [ ! -f ${GLITE_LB_LOCATION_ETC}/gLiteservices ] ; then + touch ${GLITE_LB_LOCATION_ETC}/gLiteservices fi - grep glite-lb-bkserverd ${GLITE_LOCATION}/etc/gLiteservices > /dev/null + grep glite-lb-bkserverd ${GLITE_LB_LOCATION_ETC}/gLiteservices > /dev/null if [ ! $? = 0 ] ; then - echo "${GLITE_LOCATION}/etc/init.d/glite-lb-bkserverd" >> ${GLITE_LOCATION}/etc/gLiteservices + echo "${GLITE_LB_LOCATION_ETC}/init.d/glite-lb-bkserverd" >> ${GLITE_LOCATION}/etc/gLiteservices fi if [ x"$GLITE_LB_RTM_ENABLED" = x"true" ]; then @@ -376,12 +376,12 @@ EOF config_glite_lb_authz "$GLITE_LB_SUPER_USERS" "" fi - if [ ! -f ${GLITE_LOCATION}/etc/glite-lb/glite-lb-harvester.conf ]; then - echo $HOSTNAME > ${GLITE_LOCATION}/etc/glite-lb/glite-lb-harvester.conf + if [ ! -f ${GLITE_LB_LOCATION_ETC}/glite-lb/glite-lb-harvester.conf ]; then + echo $HOSTNAME > ${GLITE_LB_LOCATION_ETC}/glite-lb/glite-lb-harvester.conf fi . ${GLITE_LOCATION}/etc/profile.d/grid-env.sh - ${GLITE_LOCATION}/etc/init.d/glite-lb-bkserverd stop + ${GLITE_LB_LOCATION_ETC}/init.d/glite-lb-bkserverd stop #Temporary workaround to kill glite-lb-*-interlogd ps ax | grep -v grep | grep glite-lb-notif-interlogd > /dev/null if [ $? = 0 ]; then @@ -391,7 +391,7 @@ EOF if [ $? = 0 ]; then killall -9 /opt/glite/bin/glite-lb-interlogd fi - ${GLITE_LOCATION}/etc/init.d/glite-lb-bkserverd start + ${GLITE_LB_LOCATION_ETC}/init.d/glite-lb-bkserverd start if [ ! $? = 0 ] ; then yaimlog ABORT "Service glite-lb-bkserverd failed to start!" diff --git a/org.glite.lb.yaim/config/node-info.d/emi/glite-lb b/org.glite.lb.yaim/config/node-info.d/emi/glite-lb new file mode 100644 index 0000000..98f45e1 --- /dev/null +++ b/org.glite.lb.yaim/config/node-info.d/emi/glite-lb @@ -0,0 +1,13 @@ +LB_FUNCTIONS=" +config_add_pool_env +config_crl +config_host_certs +config_edgusers +config_gip_only +config_gip_lb +config_info_service_lb +config_gip_service_release +config_glite_lb +config_glite_locallogger +config_bdii_5.1 +config_glite_initd" diff --git a/org.glite.lb/configure b/org.glite.lb/configure index 0279f57..67f58dc 100755 --- a/org.glite.lb/configure +++ b/org.glite.lb/configure @@ -31,6 +31,7 @@ my $stagedir = undef; my $root = $pwd.'/stage'; my $sysroot = ''; my $sysconfdir; +my $localstatedir; my $staged; my $module; my $thrflavour = 'gcc64dbgpthr'; @@ -193,7 +194,8 @@ my @opts = ( 'stage=s' => \$stagedir, 'root:s' => \$root, 'sysroot:s' => \$sysroot, - 'sysconfdir:s' => \$sysconfdir, + 'sysconfdir=s' => \$sysconfdir, + 'localstatedir=s' => \$localstatedir, 'lb-tag=s' => \$lb_tag, 'lbjp-common-tag=s' => \$lbjp_tag, 'jp-tag=s' => \$jp_tag, @@ -223,7 +225,9 @@ $stage=~s/\/$//; $root=~s/\/$//; $sysroot=~s/\/$//; if (not $sysconfdir) { $sysconfdir = $prefix eq '/usr' ? '/etc' : "$prefix/etc"; } +if (not $localstatedir) { $localstatedir = $prefix eq '/usr' ? '/var' : "$prefix/var"; } $sysconfdir=~s/\/$//; +$localstatedir=~s/\/$//; $externs{'mysql-devel'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-devel'}{prefix} eq ''; $externs{'mysql-server'}{prefix}=$externs{mysql}{prefix} if $externs{'mysql-server'}{prefix} eq ''; @@ -705,6 +709,7 @@ prefix = $prefix stagedir = $stagedir sysroot = $sysroot sysconfdir = $sysconfdir +localstatedir = $localstatedir thrflavour = $thrflavour nothrflavour = $nothrflavour libdir = $libdir @@ -909,16 +914,13 @@ sub mode_etics { } } elsif ($subsys eq 'px' and $module eq 'myproxy-config') { - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --prefix=\${prefix} --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts"; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure --root=\${prefix} --prefix= --stage=\${stageDir} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts"; $cmd{packaging} = "make rpm package=".$confprefix."$subsys-myproxy-config"; } else { my $flavours = $emi ? "--thrflavour= --nothrflavour=" : "--thrflavour=\${globus.thr.flavor} --nothrflavour=\${globus.nothr.flavor}"; - my $localprefix = $emi ? '/usr' : ''; - my $sysconfdir = ' --sysconfdir=/etc'; - # exception for yaims in EMI for now: prefix /opt/glite - if ($emi and ($module =~ /yaim/ or $module =~ /^glite-/)) { $localprefix = '/opt/glite'; $sysconfdir = ''; } - $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --root=\${prefix} --prefix=${localprefix} --stage=\${stageDir} --sysroot=\${package.prefix}$sysconfdir --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts"; + my $local_prefix = $emi ? '/usr' : ''; + $cmd{configure} = "cd $confdir && /usr/bin/perl \${moduleName}/configure $flavours --root=\${prefix} --prefix=$local_prefix --stage=\${stageDir} --sysroot=\${package.prefix} --libdir=\${libdir} --project=\${projectName} --module $subsys.$module @copts"; $cmd{compile} = 'make'; $cmd{test} = 'make check'; $cmd{install} = 'make install'; diff --git a/org.glite.px.myproxy-yaim/Makefile b/org.glite.px.myproxy-yaim/Makefile index d4e6b7b..0ad8e8d 100644 --- a/org.glite.px.myproxy-yaim/Makefile +++ b/org.glite.px.myproxy-yaim/Makefile @@ -3,35 +3,43 @@ stagedir=. package=glite-px-myproxy-yaim version=0.0.0 PREFIX=/opt/glite -prefix= +yaim_prefix= sysconfdir=/opt/glite/etc -include Makefile.inc -include ../project/version.properties -all: +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 -install: - mkdir -p ${DESTDIR}${PREFIX}${prefix}/yaim/functions/ - mkdir -p ${DESTDIR}${PREFIX}${prefix}/yaim/node-info.d - mkdir -p ${DESTDIR}${PREFIX}${prefix}/yaim/examples/siteinfo/services - mkdir -p ${DESTDIR}${PREFIX}${prefix}/yaim/etc/versions - mkdir -p ${DESTDIR}${PREFIX}${prefix}/yaim/defaults - install -m 0644 $(top_srcdir)/config/services/glite-px ${DESTDIR}${PREFIX}${prefix}/yaim/examples/siteinfo/services/glite-px - for c in gip_px info_service_px proxy_server ; do \ - install -m 0644 $(top_srcdir)/config/functions/config_$$c ${DESTDIR}${PREFIX}${prefix}/yaim/functions; \ - done - # dirty hack for EPEL - flavour-less globus not initialized by gpt - if test "x$(thrflavour)" = "x"; then \ - grep -v config_globus_clients $(top_srcdir)/config/node-info.d/glite-px > glite-px; \ - install -m 0644 glite-px ${DESTDIR}${PREFIX}${prefix}/yaim/node-info.d; \ - prefix=/usr sysconfdir=/etc $(top_srcdir)/config/defaults/glite-px.pre.sh > glite-px.pre; \ +FILES=glite-px.pre glite-px + +all ${FILES}: + if test -f "${node_info_project}"; then \ + cp ${node_info_project} . ; \ else \ - install -m 0644 $(top_srcdir)/config/node-info.d/glite-px ${DESTDIR}${PREFIX}${prefix}/yaim/node-info.d; \ - prefix=${sysrootdir}${prefix} sysconfdir=${sysconfdir} $(top_srcdir)/config/defaults/glite-px.pre.sh > glite-px.pre; \ + cp ${node_info} . ; \ fi - install -m 0644 glite-px.pre ${DESTDIR}${PREFIX}${prefix}/yaim/defaults - echo "$(package) $(module.version)-$(module.age)" > ${DESTDIR}${PREFIX}${prefix}/yaim/etc/versions/$(package) + glite_var="${localstatedir}/glite"; \ + if echo "${localstatedir}" | grep 'glite'>/dev/null; then \ + glite_var="${localstatedir}"; \ + fi; \ + sed -e 's:@glite_prefix@:${sysroot}${prefix}:' -e 's:@glite_etc@:${sysconfdir}:' -e "s:@glite_var@:$$glite_var:" $(top_srcdir)/config/defaults/glite-px.pre > glite-px.pre + +install: ${FILES} + mkdir -p ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/functions/ + mkdir -p ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/node-info.d + mkdir -p ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/examples/siteinfo/services + 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 \ + 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 glite-px.pre ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/defaults + echo "$(package) $(module.version)-$(module.age)" > ${DESTDIR}${PREFIX}${yaim_prefix}/yaim/etc/versions/$(package) stage: $(MAKE) install PREFIX=${stagedir} @@ -39,6 +47,6 @@ stage: check: clean: - rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/ debian/ + rm -rvf log.xml project/ rpmbuild/ RPMS/ tgz/ debian/ ${FILES} .PHONY: default all check stage clean diff --git a/org.glite.px.myproxy-yaim/config/defaults/glite-px.pre b/org.glite.px.myproxy-yaim/config/defaults/glite-px.pre new file mode 100644 index 0000000..9416c10 --- /dev/null +++ b/org.glite.px.myproxy-yaim/config/defaults/glite-px.pre @@ -0,0 +1,3 @@ +GLITE_PX_LOCATION='@glite_prefix@' +GLITE_PX_LOCATION_ETC='@glite_etc@' +GLITE_PX_LOCATION_VAR='@glite_var@' diff --git a/org.glite.px.myproxy-yaim/config/defaults/glite-px.pre.sh b/org.glite.px.myproxy-yaim/config/defaults/glite-px.pre.sh deleted file mode 100755 index 6a393bd..0000000 --- a/org.glite.px.myproxy-yaim/config/defaults/glite-px.pre.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/sh -cat <