# chkconfig: - 59 76
# description: Part of the lustre file system.
# probe: true
-# config: /etc/sysconfig/lustre
+# config: /etc/sysconfig/lnet
# Source function library.
[ -f /etc/rc.d/init.d/functions ] && . /etc/rc.d/init.d/functions
ksocklnd \
kqswlnd \
ko2iblnd \
- fsfilt_ldiskfs \
obdclass \
lnet \
lvfs \
egrep -q "lnet" /proc/modules && STATE="loaded"
# check for any routes - on a portals router this is the only thing
- [ "`cat /proc/sys/lnet/routes 2> /dev/null`" ] && STATE="running" && RETVAL=0
+ VAR=$(lctl get_param -n routes 2>&1)
+ if [ $? = 0 ] ; then
+ STATE="running"
+ RETVAL=0
+ fi
# check if this is a router
- if [ -d /proc/sys/lnet ]; then
- ROUTER="`cat /proc/sys/lnet/routes | head -1 | grep -i -c \"Routing enabled\"`"
- if [[ ! -z ${ROUTER} && ${ROUTER} -ge 1 ]]; then
- STATE="running"
- RETVAL=0
- fi
+ if [[ "$(lctl get_param -n routes)" =~ "Routing enabled" ]]; then
+ STATE="running"
+ RETVAL=0
fi
# check for error in health_check
- HEALTH="/proc/fs/lustre/health_check"
- [ -f "$HEALTH" ] && grep -q "NOT HEALTHY" $HEALTH && STATE="unhealthy" && RETVAL=1
+ local health_check=$(lctl get_param -n health_check)
+ if [[ "$health_check" =~ "NOT HEALTHY" ]]; then
+ STATE="unhealthy"
+ RETVAL=1
+ fi
- # check for LBUG
- [ -f "$HEALTH" ] && grep -q "LBUG" $HEALTH && STATE="LBUG" && RETVAL=152
+ if [[ "$health_check" =~ "LBUG" ]]; then
+ STATE="LBUG"
+ RETVAL=152
+ fi
echo $STATE
eval $old_nullglob