Skip to content

Commit

Permalink
HYD-1263 Load lustre modules prior to any mounts
Browse files Browse the repository at this point in the history
Original-Change-Id: Iff9c792475e59a6347471b79a5af1d177e23ab31
  • Loading branch information
Brian J. Murrell committed Aug 17, 2012
1 parent 7335875 commit 5c18725
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ rpms: production cleandist tarball
mkdir -p _topdir/{BUILD,S{PEC,OURCE,RPM}S,RPMS/noarch}
cp dist/chroma-agent-*.tar.gz _topdir/SOURCES
cp chroma-agent-init.sh _topdir/SOURCES
cp lustre-modules-init.sh _topdir/SOURCES
cp chroma-agent.spec _topdir/SPECS
rpmbuild --define "_topdir $$(pwd)/_topdir" \
--define "version $(PACKAGE_VERSION)" \
Expand Down
4 changes: 4 additions & 0 deletions chroma-agent.spec
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Version: %{version}
Release: %{release}
Source0: %{name}-%{version}.tar.gz
Source1: chroma-agent-init.sh
Source2: lustre-modules-init.sh
License: Proprietary
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Expand Down Expand Up @@ -45,6 +46,7 @@ rm -rf %{buildroot}
%{__python} setup.py install --skip-build --install-lib=%{python_sitelib} --install-scripts=%{_bindir} --root=%{buildroot}
mkdir -p $RPM_BUILD_ROOT/etc/init.d/
cp %{SOURCE1} $RPM_BUILD_ROOT/etc/init.d/chroma-agent
cp %{SOURCE2} $RPM_BUILD_ROOT/etc/init.d/lustre-modules

touch management.files
cat <<EndOfList>>management.files
Expand All @@ -70,6 +72,7 @@ rm -rf %{buildroot}

%post
chkconfig chroma-agent on
chkconfig lustre-modules on
# disable SELinux -- it prevents both lustre and pacemaker from working
sed -ie 's/^SELINUX=.*$/SELINUX=disabled/' /etc/selinux/config
# the above only disables on the next boot. disable it currently, also
Expand All @@ -82,6 +85,7 @@ chkconfig corosync on
%files -f base.files
%defattr(-,root,root)
%attr(0755,root,root)/etc/init.d/chroma-agent
%attr(0755,root,root)/etc/init.d/lustre-modules
%{_bindir}/chroma-agent*
%{python_sitelib}/chroma_agent-*.egg-info/*

Expand Down
3 changes: 3 additions & 0 deletions chroma_agent/action_plugins/manage_lnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ def stop_lnet(args):

def load_lnet(args):
try_run(["modprobe", "lnet"])
# hack for HYD-1263 - Fix or work around LU-1279 - failure trying to mount two targets at the same time after boot
# should be removed when LU-1279 is fixed
try_run(["modprobe", "lustre"])


def unload_lnet(args):
Expand Down
40 changes: 40 additions & 0 deletions lustre-modules-init.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/bin/bash
#
# lustre This loads the lustre modules
#
# chkconfig: 2345 11 99
# description: This loads the Lustre modules.


PATH=/sbin:/bin:/usr/bin:/usr/sbin

# Source function library.
. /etc/init.d/functions

# Check that we are root ... so non-root users stop here
test $EUID = 0 || exit 4

RETVAL=0

start(){
echo -n "Loading Lustre module stack..."
/sbin/modprobe lustre
RETVAL=$?
echo
return $RETVAL
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
:
;;
*)
echo $"Usage: $0 {start|stop}"
RETVAL=3
esac

exit $RETVAL

0 comments on commit 5c18725

Please sign in to comment.