-#!/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
# 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
}
status $SERVICE
;;
*)
- echo $"Usage: $SERVICE {start|stop|restart|status}"
+ echo "Usage: $SERVICE {start|stop|restart|status}"
exit 1
esac
exit $RETVAL
-