Add config_glite_locallogger to functions/local since the change is
authorDi Qing <Di.Qing@cern.ch>
Tue, 7 Aug 2007 17:46:47 +0000 (17:46 +0000)
committerDi Qing <Di.Qing@cern.ch>
Tue, 7 Aug 2007 17:46:47 +0000 (17:46 +0000)
not in 3.1.1 core yet

org.glite.yaim.lb/config/functions/local/config_glite_locallogger [new file with mode: 0644]

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 (file)
index 0000000..2801006
--- /dev/null
@@ -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
+}