An "overriding commands for target `lustre'" build warning resulted
from the addition of lustre to the genscripts Makefile variable. In
fact the genscripts processing is superfluous for the lustre script,
so we could just fix the warning by removing it. However, generating
the script from a .in file seems unnecessarily complicated, so this
change goes a step further by making the script static. It now
detects at run-time whether to use the ldiskfsprogs or the e2fsprogs
utilities, instead of using autoconf macros to encode it at build
time.
Signed-off-by: Ned Bass <bass6@llnl.gov>
Change-Id: Ie000a87adabbc2a001ed9ff2f5750041a5abea5b
Reviewed-on: http://review.whamcloud.com/4015
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
lustre/quota/Makefile
lustre/quota/autoMakefile
lustre/scripts/Makefile
lustre/quota/Makefile
lustre/quota/autoMakefile
lustre/scripts/Makefile
lustre/tests/Makefile
lustre/tests/mpi/Makefile
lustre/utils/Makefile
lustre/tests/Makefile
lustre/tests/mpi/Makefile
lustre/utils/Makefile
+# 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"
# 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 \
# 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
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) \
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@
haconfig ldev Lustre
scriptlibdir = @libexecdir@/@PACKAGE@
# probe: true
# config: /etc/sysconfig/lustre
# probe: true
# config: /etc/sysconfig/lustre
+PATH=/sbin:/usr/sbin:/bin:/usr/bin
+
# Source function library.
. /etc/rc.d/init.d/functions
# Source function library.
. /etc/rc.d/init.d/functions
MOUNT_DELAY=${MOUNT_DELAY:-2}
LOAD_ZFS=${LOAD_ZFS:-""}
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 ()
shopt -s nullglob
start_zfs_services ()
devices=`echo $devices |xargs -n 1|grep '^/'|xargs`
if [ -n "${FSCK_ARGS}" -a -n "$devices" ]; then
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
if [ $? -ne 0 -a $? -ne 1 ] ; then
- echo "FAILED: @PFSCK@ -- ${FSCK_ARGS}: $?"
+ echo "FAILED: $PFSCK -- ${FSCK_ARGS}: $?"
- echo "/sbin/@PFSCK@ not found"
+ echo "$PFSCK not found"
local result=1
local feature
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
| grep features: | sed -e 's/^.*: //'`; do
if [ "$feature" == "$flag" ]; then
result=0
local result=0
if [ "$REQUIRE_MMP_FEATURE" == "yes" ]; then
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
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"