#
#FSCK_ARGS="-p"
+# By default the init script will check ldiskfs filesystems using
+# /sbin/fsck.ldiskfs if it exists, otherwise it will use /sbin/fsck.
+# Set the PFSCK variable here to override that behavior. The value must
+# be an absolute path.
+#
+#PFSCK=/sbin/fsck
+
+# By default the init script will test ldiskfs feature flags using
+# /sbin/tunefs.ldiskfs if it exists, otherwise it will use
+# /sbin/tune2fs. Set the TUNE2FS variable here to override that
+# behavior. The value must be an absolute path.
+#
+#TUNE2FS=/sbin/tune2fs
+
# Uncomment to insert server mount options - see mount.lustre(8)
#MOUNT_OPTIONS="-o abort_recov"
# These are scripts that are generated from .in files
genscripts = lustre_config lc_modprobe lc_net lc_hb lc_cluman lustre_createcsv \
- lc_md lc_lvm lustre_start lustre
+ lc_md lc_lvm lustre_start
initdir = $(sysconfdir)/init.d
init_SCRIPTS = lustre lnet
EXTRA_DIST = license-status maketags.sh version_tag.pl version_tag-git.pl \
version_tag-cvs.pl version_tag-none.pl lc_common \
$(addsuffix .in,$(genscripts)) lc_mon $(sbinscripts) \
- $(bin_SCRIPTS) make_META.pl lustre.in lnet lhbadm \
+ $(bin_SCRIPTS) make_META.pl lustre lnet lhbadm \
haconfig ldev Lustre
scriptlibdir = @libexecdir@/@PACKAGE@
# probe: true
# config: /etc/sysconfig/lustre
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
# Source function library.
. /etc/rc.d/init.d/functions
MOUNT_DELAY=${MOUNT_DELAY:-2}
LOAD_ZFS=${LOAD_ZFS:-""}
+if [ -z "$TUNE2FS" ] ; then
+ TUNE2FS=`which tunefs.ldiskfs 2>/dev/null`
+ if [ -z "$TUNE2FS" ] ; then
+ TUNE2FS=`which tune2fs 2>/dev/null`
+ fi
+fi
+
+if [ -z "$PFSCK" ] ; then
+ PFSCK=`which pfsck.ldiskfs 2>/dev/null`
+ if [ -z "$PFSCK" ] ; then
+ PFSCK=`which fsck 2>/dev/null`
+ fi
+fi
+
shopt -s nullglob
start_zfs_services ()
devices=`echo $devices |xargs -n 1|grep '^/'|xargs`
if [ -n "${FSCK_ARGS}" -a -n "$devices" ]; then
- if [ -x /sbin/@PFSCK@ ] ; then
- echo "@PFSCK@ $devices -- ${FSCK_ARGS}"
- /sbin/@PFSCK@ $devices -- ${FSCK_ARGS}
+ if [ -x $PFSCK ] ; then
+ echo "$PFSCK $devices -- ${FSCK_ARGS}"
+ $PFSCK $devices -- ${FSCK_ARGS}
if [ $? -ne 0 -a $? -ne 1 ] ; then
- echo "FAILED: @PFSCK@ -- ${FSCK_ARGS}: $?"
+ echo "FAILED: $PFSCK -- ${FSCK_ARGS}: $?"
return 1
fi
else
- echo "/sbin/@PFSCK@ not found"
+ echo "$PFSCK not found"
return 1
fi
fi
local result=1
local feature
- for feature in `/sbin/@TUNE2FS@ -l $dev 2>/dev/null \
+ for feature in `$TUNE2FS -l $dev 2>/dev/null \
| grep features: | sed -e 's/^.*: //'`; do
if [ "$feature" == "$flag" ]; then
result=0
local result=0
if [ "$REQUIRE_MMP_FEATURE" == "yes" ]; then
- if [ -x /sbin/@TUNE2FS@ ]; then
+ if [ -x $TUNE2FS ]; then
if ! test_feature_flag $dev "mmp"; then
echo "mmp feature flag is not set on $dev"
result=1
fi
else
- echo "/sbin/@TUNE2FS@ not found"
+ echo "$TUNE2FS not found"
result=1
fi
fi