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}"}
23 # Source function library.
24 if [ -f /etc/init.d/functions ] ; then
25 . /etc/init.d/functions
28 # Source networking configuration.
29 if [ -f /etc/sysconfig/network ] ; then
30 . /etc/sysconfig/network
33 # Check that networking is up.
34 [ "${NETWORKING}" = "no" ] && exit 0
36 [ -x ${LCONF} -a -f ${LUSTRE_CONFIG_XML} ] || exit 0
38 # Create /var/lustre directory
39 # This is used by snmp agent for checking lustre services \
40 # status online/offline/online pending/offline pending.
42 [ -d ${STATUS_DIR:=/var/lustre} ] || mkdir -p $STATUS_DIR
43 STATUS=${STATUS_DIR}/sysStatus
46 echo -n "Starting $SERVICE: "
47 ${LCONF} ${LCONF_START_ARGS}
50 if [ $RETVAL -eq 0 ]; then
52 echo "online" >$STATUS
54 echo "online pending" >$STATUS
59 echo -n "Shutting down $SERVICE: "
60 ${LCONF} ${LCONF_STOP_ARGS}
64 if [ $RETVAL -eq 0 ]; then
65 echo "offline" >$STATUS
67 echo "offline pending" >$STATUS
76 # See how we were called.
91 echo "Usage: $SERVICE {start|stop|restart|status}"