Whamcloud - gitweb
LU-107 scripts: rename heartbeat resource agent
authorNed Bass <bass6@llnl.gov>
Tue, 9 Oct 2012 20:10:18 +0000 (13:10 -0700)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 11 Oct 2012 07:36:47 +0000 (03:36 -0400)
Add a .ha_v2 extension to the Lustre heartbeat resource agent script
to resolve conflicts with the lustre init script on case-insensitive
filesystems.  The extension also provides a clue as to what the
script's purpose is.  Add a compatibility symlink with the plain name
during package installation.   If we later add v3-style scripts we can
control which one gets linked to via a configure option.

Signed-off-by: Ned Bass <bass6@llnl.gov>
Change-Id: I0e37a390fbfb3f00c1c1e666a7cdbe5d37fa885b
Reviewed-on: http://review.whamcloud.com/4233
Tested-by: Hudson
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
lustre.spec.in
lustre/scripts/Lustre.ha_v2 [moved from lustre/scripts/Lustre with 100% similarity]
lustre/scripts/Makefile.am

index 1e50a00..05920ce 100644 (file)
@@ -208,6 +208,11 @@ elif [ -e ${llog_base}.o ]; then
   cp ${llog_base}.o $RPM_BUILD_ROOT/lib/modules/%{kversion}/updates/kernel/fs/lustre
 fi
 
   cp ${llog_base}.o $RPM_BUILD_ROOT/lib/modules/%{kversion}/updates/kernel/fs/lustre
 fi
 
+# The .ha_v2 extension identifies the heartbeat resource agent as using
+# legacy syntax. Install a compatibility symlink to avoid conflicts when
+# newer-style agents are added.
+ln -s Lustre.ha_v2 $RPM_BUILD_ROOT/etc/ha.d/resource.d/Lustre
+
 # Create the pristine source directory.
 cd $RPM_BUILD_DIR/lustre-%{version}
 mkdir -p $RPM_BUILD_ROOT/usr/src
 # Create the pristine source directory.
 cd $RPM_BUILD_DIR/lustre-%{version}
 mkdir -p $RPM_BUILD_ROOT/usr/src
@@ -240,6 +245,7 @@ cat >lustre.files <<EOF
 %attr(-, root, root) %{_sysconfdir}/ldev.conf
 %attr(-, root, root) %{_sysconfdir}/sysconfig/lustre
 %attr(-, root, root) %{_libexecdir}/lustre/haconfig
 %attr(-, root, root) %{_sysconfdir}/ldev.conf
 %attr(-, root, root) %{_sysconfdir}/sysconfig/lustre
 %attr(-, root, root) %{_libexecdir}/lustre/haconfig
+%attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2
 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre
 EOF
 
 %attr(-, root, root) %{_sysconfdir}/ha.d/resource.d/Lustre
 EOF
 
index 04f9ee2..970d4c9 100644 (file)
@@ -44,7 +44,7 @@ initdir = $(sysconfdir)/init.d
 init_SCRIPTS = lustre lnet
 
 hadir = $(sysconfdir)/ha.d/resource.d
 init_SCRIPTS = lustre lnet
 
 hadir = $(sysconfdir)/ha.d/resource.d
-ha_SCRIPTS = Lustre
+ha_SCRIPTS = Lustre.ha_v2
 
 sbin_SCRIPTS = $(genscripts) $(sbinscripts)
 bin_SCRIPTS = lustre_req_history lfs_migrate
 
 sbin_SCRIPTS = $(genscripts) $(sbinscripts)
 bin_SCRIPTS = lustre_req_history lfs_migrate
@@ -53,7 +53,7 @@ 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 lnet lhbadm \
             version_tag-cvs.pl version_tag-none.pl lc_common \
             $(addsuffix .in,$(genscripts)) lc_mon $(sbinscripts) \
             $(bin_SCRIPTS) make_META.pl lustre lnet lhbadm \
-            haconfig ldev Lustre
+            haconfig ldev Lustre.ha_v2
 
 scriptlibdir = @libexecdir@/@PACKAGE@
 scriptlib_SCRIPTS = haconfig
 
 scriptlibdir = @libexecdir@/@PACKAGE@
 scriptlib_SCRIPTS = haconfig