3 # lustre This shell script takes care of starting and stopping Lustre
6 # description: Lustre Lite network File System. \
7 # This starts both Lustre client and server functions.
9 # config: /etc/lustre/config.xml
10 # pidfile: /var/run/lustre.pid
13 LOCK=/var/lock/subsys/$SERVICE
15 : ${LUSTRE_CFG:=/etc/lustre/lustre.cfg}
16 [ -f ${LUSTRE_CFG} ] && . ${LUSTRE_CFG}
18 : ${LUSTRE_CONFIG_XML:=/etc/lustre/config.xml}
19 : ${LCONF:=/usr/sbin/lconf}
20 : ${LCONF_START_ARGS:="${LUSTRE_CONFIG_XML}"}
21 : ${LCONF_STOP_ARGS:="--force --cleanup ${LUSTRE_CONFIG_XML}"}
22 : ${LCTL:=/usr/sbin/lctl}
24 # Source function library.
25 if [ -f /etc/init.d/functions ] ; then
26 . /etc/init.d/functions
29 # Source networking configuration.
30 if [ -f /etc/sysconfig/network ] ; then
31 . /etc/sysconfig/network
34 # Check that networking is up.
35 [ "${NETWORKING}" = "no" ] && exit 0
37 [ -x ${LCONF} -a -x ${LCTL} ] || exit 0
39 [ -f ${LUSTRE_CONFIG_XML} ] || ( echo "unconfigured" && exit 0 )
41 # Create /var/lustre directory
42 # This is used by snmp agent for checking lustre services \
43 # status online/offline/online pending/offline pending.
45 [ -d ${STATUS_DIR:=/var/lustre} ] || mkdir -p $STATUS_DIR
46 STATUS=${STATUS_DIR}/sysStatus
49 echo -n "Starting $SERVICE: "
50 ${LCONF} ${LCONF_START_ARGS}
53 if [ $RETVAL -eq 0 ]; then
55 echo "online" >$STATUS
57 echo "online pending" >$STATUS
62 echo -n "Shutting down $SERVICE: "
63 ${LCONF} ${LCONF_STOP_ARGS}
67 if [ $RETVAL -eq 0 ]; then
68 echo "offline" >$STATUS
70 echo "offline pending" >$STATUS
80 ${LCTL} dl 2>/dev/null | while read INDEX STAT MODULE NAME; do
83 [ "`grep -v FULL /proc/fs/lustre/*c/*/*_server_uuid`" ] \
84 && echo "recovery" || echo "running"
92 # See how we were called.
107 echo "Usage: $SERVICE {start|stop|restart|status}"