From: narasimd Date: Wed, 11 Dec 2002 06:53:25 +0000 (+0000) Subject: Merging to head, BUG#405 X-Git-Tag: 0.5.19~70 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=a5a8894affe205fe53b8af56a961147afc163597;p=fs%2Flustre-release.git Merging to head, BUG#405 --- diff --git a/lustre/scripts/lustre b/lustre/scripts/lustre index b62dc4c..95c1d06 100755 --- a/lustre/scripts/lustre +++ b/lustre/scripts/lustre @@ -35,19 +35,37 @@ fi [ -x ${LCONF} -a -f ${LUSTRE_CONFIG_XML} ] || exit 0 +# Create /var/lustre directory +# This is used by snmp agent for checking lustre services \ +# status online/offline/online pending/offline pending. + +[ -d ${STATUS_DIR:=/var/lustre} ] || mkdir -p $STATUS_DIR +STATUS=${STATUS_DIR}/sysStatus + start() { echo -n "Starting $SERVICE: " - ${LCONF} ${LCONF_START_ARGS} + ${LCONF} ${LCONF_START_ARGS} RETVAL=$? echo $SERVICE - [ $RETVAL -eq 0 ] && touch $LOCK + if [ $RETVAL -eq 0 ]; then + touch $LOCK + echo "online" >$STATUS + else + echo "online pending" >$STATUS + fi } stop() { echo -n "Shutting down $SERVICE: " - ${LCONF} ${LCONF_STOP_ARGS} - echo $SERVICE - rm -f $LOCK + ${LCONF} ${LCONF_STOP_ARGS} + RETVAL=$? + echo $SERVICE + rm -f $LOCK + if [ $RETVAL -eq 0 ]; then + echo "offline" >$STATUS + else + echo "offline pending" >$STATUS + fi } restart() {