#! /bin/sh # Globus Startup Script # # This script should be placed in /etc/rc3.d/S[nn]globus # where nn is a number in the range 00..99 PROGRAM_NAME=`echo $0 | ${GLOBUS_SH_SED-sed} -e 's|.*/||g'` PROGRAM_VERSION=`echo '$Revision: 1.1.1.1 $' | ${GLOBUS_SH_CUT-cut} -d' ' -f2` #globus_hostname="" globus_hostname=`hostname -f` if [ -n "${globus_hostname}" ]; then GLOBUS_HOSTNAME="${globus_hostname}" export GLOBUS_HOSTNAME fi # Inserted by configure. ################# BEGIN Inserted by configure ############# GLOBUS_DEPLOY_PATH=/opt/globus GLOBUS_DEPLOYED='TRUE' if [ -n "${GSI_INSTALL_PATH}" -a -z "${GLOBUS_INSTALL_PATH}" ]; then GLOBUS_INSTALL_PATH=${GSI_INSTALL_PATH} fi if [ -n "${GSI_DEPLOY_PATH}" -a -z "${GLOBUS_DEPLOY_PATH}" ]; then GLOBUS_DEPLOY_PATH=/opt/globus fi if [ "X${GLOBUS_DEPLOYED}" = "XTRUE" ]; then if [ -z "${GLOBUS_DEPLOY_PATH}" ]; then echo "ERROR: environment variable GLOBUS_DEPLOY_PATH not defined" 1>&2 exit 1 fi if [ -z "${GLOBUS_INSTALL_PATH}" ]; then if [ ! -r "${GLOBUS_DEPLOY_PATH}/etc/globus-install-path.sh" ]; then echo "ERROR: cannot read ${GLOBUS_DEPLOY_PATH}/etc/globus-install-path.sh" 1>&2 exit 1 fi . "${GLOBUS_DEPLOY_PATH}/etc/globus-install-path.sh" if [ -z "${GLOBUS_INSTALL_PATH}" ]; then echo "ERROR: environment variable GLOBUS_INSTALL_PATH not defined" 1>&2 echo "in ${GLOBUS_DEPLOY_PATH}/etc/globus-install-path.sh" 1>&2 exit 1 fi fi else if [ -z "${GLOBUS_INSTALL_PATH}" ]; then echo "ERROR: environment variable GLOBUS_INSTALL_PATH not defined" 1>&2 # for easier development testing, fall back on ${prefix} and don't exit # GLOBUS_INSTALL_PATH=/usr/local/globus exit 1 fi fi if [ "X${GLOBUS_DEPLOYED}" = "XTRUE" ]; then export GLOBUS_DEPLOY_PATH prefix=${GLOBUS_DEPLOY_PATH} exec_prefix=${GLOBUS_DEPLOY_PATH} arch="`${prefix}/sbin/config.guess`" arch_sysconfdir="${prefix}/etc/${arch}" else prefix="${GLOBUS_INSTALL_PATH}" exec_prefix=${GLOBUS_INSTALL_PATH}/services/i686-pc-linux-gnu if [ "X${GLOBUS_ARCHITECTURE_INDEPENDENT}" = "XTRUE" ]; then if [ '${GLOBUS_INSTALL_PATH}/services/i686-pc-linux-gnu' != '${prefix}' ] ; then arch="`${GLOBUS_INSTALL_PATH}/sbin/config.guess`" exec_prefix="${prefix}/services/${arch}" arch_sysconfdir="${prefix}/etc/${arch}" fi fi fi export GLOBUS_INSTALL_PATH sbindir=${exec_prefix}/sbin bindir=${exec_prefix}/bin libdir=${exec_prefix}/lib libexecdir=${exec_prefix}/libexec includedir=${exec_prefix}/include datadir=${prefix}/share sysconfdir=${prefix}/etc sharedstatedir=${prefix}/com localstatedir=${prefix}/var tmpdir=${prefix}/tmp local_tmpdir=/tmp secure_tmpdir=${local_tmpdir} [ -z "${arch_sysconfdir}" ] && arch_sysconfdir=/usr/local/globus/etc/i686-pc-linux-gnu if [ -z "${GLOBUS_SSL_PATH}" ]; then if [ -r "${arch_sysconfdir}/globus-ssl-path-32.sh" ] ; then globus_ssl_path_sh="${arch_sysconfdir}/globus-ssl-path-32.sh" elif [ -r "${arch_sysconfdir}/globus-ssl-path-64.sh" ] ; then globus_ssl_path_sh="${arch_sysconfdir}/globus-ssl-path-64.sh" else echo "ERROR: cannot resolve path to SSL installation -- excepted" 1>&2 echo "to find this information in ${arch_sysconfdir}" 1>&2 echo "Set environment variable GLOBUS_SSL_PATH and try again" 1>&2 exit 1 fi . "${globus_ssl_path_sh}" if [ -z "${GLOBUS_SSL_PATH}" ]; then echo "ERROR: value for GLOBUS_SSL_PATH not defined" 1>&2 echo "in ${globus_ssl_path_sh}" 1>&2 exit 1 fi fi if [ -z "$GLOBUS_SH_VARIABLES_SET" ]; then if [ ! -r ${arch_sysconfdir}/globus-sh-commands.sh ] ; then echo "ERROR: cannot read ${arch_sysconfdir}/globus-sh-commands.sh" 1>&2 exit 1 fi . ${arch_sysconfdir}/globus-sh-commands.sh for _var in `${GLOBUS_SH_SED} -n '/^GLOBUS_SH/s/=.*$//p' \ ${arch_sysconfdir}/globus-sh-commands.sh` do export ${_var} done GLOBUS_SH_VARIABLES_SET="Y" export GLOBUS_SH_VARIABLES_SET fi globus_source () { # Check if file exists and source it if [ ! -f "$1" ] ; then ${GLOBUS_SH_PRINTF-printf} "$1 not found.\n" >&2 exit 1 fi . "$1" } globus_get_ldap_path () { if [ -z "${GLOBUS_LDAP_PATH}" ]; then if [ -r "${arch_sysconfdir}/globus-ldap-path-32.sh" ] ; then globus_ldap_path_sh="${arch_sysconfdir}/globus-ldap-path-32.sh" elif [ -r "${arch_sysconfdir}/globus-ldap-path-64.sh" ] ; then globus_ldap_path_sh="${arch_sysconfdir}/globus-ldap-path-64.sh" else echo "ERROR: cannot resolve path to LDAP installation -- excepted" 1>&2 echo "to find this information in ${arch_sysconfdir}" 1>&2 echo "Set environment variable GLOBUS_LDAP_PATH and try again" 1>&2 exit 1 fi . "${globus_ldap_path_sh}" if [ -z "${GLOBUS_LDAP_PATH}" ]; then echo "ERROR: value for GLOBUS_LDAP_PATH not defined" 1>&2 echo "in ${globus_ldap_path_sh}" 1>&2 exit 1 fi fi } ################# END Inserted by configure ############# if [ "X${GLOBUS_DEPLOYED}" = "XFALSE" ]; then echo "$PROGRAM_NAME should only be executed from the \"deploy\" directory" exit 1; fi . ${sbindir}/globus-startup-lib.sh . ${sysconfdir}/grid-info.conf PID_FILE=${localstatedir}/resourceslapd_`hostname`.pid ARGS_FILE=${localstatedir}/resourceslapd_`hostname`.args # Define "command" to be either start or stop command="$1" if [ -z "$command" ] ; then case "$PROGRAM_NAME" in S*globus) command="start" ;; K*globus) command="stop" ;; esac fi case "$command" in 'start') echo "Starting up Openldap 1.2.7 SLAPD server for the GRIS" ${sbindir}/grid-info-soft-register -log ${localstatedir}/grid-info-system.log -f ${sysconfdir}/grid-info-resource-register-gris.conf -- ${libexecdir}/slapd -p 2135 -d 1 -f ${sysconfdir}/grid-info-resource-slapd-gris.conf & echo $! > $PID_FILE if [ $? -ne 0 ] ; then echo "Failed to start up Openldap 1.2.7 SLAPD server for the GRIS" fi ;; 'stop') if [ -f $PID_FILE ] ; then kill -TERM `cat $PID_FILE` rm -f $PID_FILE $ARGS_FILE else kill -TERM `ps auxww | grep grid-info-soft-register | grep '\-- ' | awk '{print $2}'` fi ;; *) echo "Usage: $0 ( start | stop )" exit 1 esac