--- /dev/null
+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
+}