From 3d73964be7a8b2d9a2c680e8fd4c789389c05931 Mon Sep 17 00:00:00 2001 From: Di Qing Date: Tue, 7 Aug 2007 17:46:47 +0000 Subject: [PATCH] Add config_glite_locallogger to functions/local since the change is not in 3.1.1 core yet --- .../functions/local/config_glite_locallogger | 60 ++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 org.glite.yaim.lb/config/functions/local/config_glite_locallogger diff --git a/org.glite.yaim.lb/config/functions/local/config_glite_locallogger b/org.glite.yaim.lb/config/functions/local/config_glite_locallogger new file mode 100644 index 0000000..2801006 --- /dev/null +++ b/org.glite.yaim.lb/config/functions/local/config_glite_locallogger @@ -0,0 +1,60 @@ +function config_glite_locallogger_setenv(){ + yaimgridenv_set GLITE_LOCATION ${INSTALL_ROOT:-opt}/glite + yaimgridenv_set GLITE_LOCATION_VAR /var/glite + yaimgridenv_set GLITE_USER ${GLITE_USER:-glite} + yaimgridenv_set GLITE_HOST_CERT ${GLITE_USER_HOME:-/home/glite}/.certs/hostcert.pem + yaimgridenv_set GLITE_HOST_KEY ${GLITE_USER_HOME:-/home/glite}/.certs/hostkey.pem + yaimgridenv_set X509_CERT_DIR /etc/grid-security/certificates + yaimgridpath_append LD_LIBRARY_PATH /opt/c-ares/lib +} + +function config_glite_locallogger() { + + ############################################# + # locallogger configuration # + ############################################# + + INSTALL_ROOT=${INSTALL_ROOT:-/opt} + + mkdir -p $GLITE_USER_HOME/.certs + chown $GLITE_USER:$GLITE_USER $GLITE_USER_HOME/.certs + chmod 0755 $GLITE_USER_HOME/.certs + cp -f /etc/grid-security/hostcert.pem /etc/grid-security/hostkey.pem $GLITE_USER_HOME/.certs/ + if [ ! $? = 0 ] ; then + echo "Please copy host certificate and key into /etc/grid-security and" + echo " $GLITE_USER_HOME/.certs/, change the owner of the ones in" + echo " $GLITE_USER_HOME/.certs/ to $GLITE_USER" + fi + chown $GLITE_USER:$GLITE_USER $GLITE_USER_HOME/.certs/hostcert.pem $GLITE_USER_HOME/.certs/hostkey.pem + chmod 0644 $GLITE_USER_HOME/.certs/hostcert.pem + chmod 0400 $GLITE_USER_HOME/.certs/hostkey.pem + + # The workaround for bug 22389 + if [ -f /etc/cron.d/locallogger.cron ]; then + yaimlog INFO "The workaround for bug 22389 already exists" + else + yaimlog INFO "Applying the workaround for bug 22389..." + +cat << EOF > /etc/cron.d/locallogger.cron +HOME=/ +MAILTO=$SITE_EMAIL + +0 */6 * * * root touch $GLITE_USER_HOME/.certs/hostcert.pem +EOF + + fi + + # Start services + if [ ! -f ${GLITE_LOCATION}/etc/gLiteservices ] ; then + touch ${GLITE_LOCATION}/etc/gLiteservices + fi + + grep glite-lb-locallogger ${GLITE_LOCATION}/etc/gLiteservices > /dev/null + if [ ! $? = 0 ] ; then + echo "${GLITE_LOCATION}/etc/init.d/glite-lb-locallogger" >> ${GLITE_LOCATION}/etc/gLiteservices + fi + + . /opt/glite/yaim/etc/grid-env-funcs.sh + . ${GRID_ENV_LOCATION}/grid-env.sh + ${GLITE_LOCATION}/etc/init.d/glite-lb-locallogger restart +} -- 1.8.2.3