Whamcloud - gitweb
Bug #364: Approver - Robert Reed: Update lustre init script to use lconf.
authordonmilos <donmilos>
Wed, 13 Nov 2002 03:39:48 +0000 (03:39 +0000)
committerdonmilos <donmilos>
Wed, 13 Nov 2002 03:39:48 +0000 (03:39 +0000)
lustre/scripts/lustre

index 6a1ff0a..b62dc4c 100755 (executable)
@@ -1,17 +1,25 @@
-#!/bin/bash
+#!/bin/sh
 #
 # lustre   This shell script takes care of starting and stopping Lustre
 #
 # chkconfig: 345 99 1
 # description: Lustre Lite network File System.                              \
 #              This starts both Lustre client and server functions.
-# processname: obdctl
-# config: /etc/lustre/lustre.cfg
+# processname: lconf
+# config: /etc/lustre/config.xml
 # pidfile: /var/run/lustre.pid
 
 SERVICE=lustre
 LOCK=/var/lock/subsys/$SERVICE
 
+: ${LUSTRE_CFG:=/etc/lustre/lustre.cfg}
+[ -f ${LUSTRE_CFG} ] && . ${LUSTRE_CFG}
+
+: ${LUSTRE_CONFIG_XML:=/etc/lustre/config.xml}
+: ${LCONF:=/usr/sbin/lconf}
+: ${LCONF_START_ARGS:="${LUSTRE_CONFIG_XML}"}
+: ${LCONF_STOP_ARGS:="--force --cleanup ${LUSTRE_CONFIG_XML}"}
+
 # Source function library.
 if [ -f /etc/init.d/functions ] ; then
    . /etc/init.d/functions
@@ -25,20 +33,20 @@ fi
 # Check that networking is up.
 [ "${NETWORKING}" = "no" ] && exit 0
 
-[ -f /usr/sbin/obdctl ] || exit 0
+[ -x ${LCONF} -a -f ${LUSTRE_CONFIG_XML} ] || exit 0
 
 start() {
-        echo -n $"Starting $SERVICE: "
-       /usr/sbin/llrsetup.sh
+        echo -n "Starting $SERVICE: "
+       ${LCONF} ${LCONF_START_ARGS}
         RETVAL=$?
         echo $SERVICE
-        [ $RETVAL = 0 ] && touch $LOCK
+        [ $RETVAL -eq 0 ] && touch $LOCK
 }
 
 stop() {
-        echo -n $"Shutting down $SERVICE: "
-       /usr/sbin/llcleanup.sh
-       echo $SERVICE              
+        echo -n "Shutting down $SERVICE: "
+       ${LCONF} ${LCONF_STOP_ARGS}
+       echo $SERVICE
        rm -f $LOCK
 }
 
@@ -62,9 +70,8 @@ case "$1" in
        status $SERVICE
        ;;
   *)
-       echo $"Usage: $SERVICE {start|stop|restart|status}"
+       echo "Usage: $SERVICE {start|stop|restart|status}"
        exit 1
 esac
 
 exit $RETVAL
-