Whamcloud - gitweb
LU-4707 build: Don’t deploy the "lustre" init script on clients 35/9535/9
authorDmitry Eremin <dmitry.eremin@intel.com>
Thu, 6 Mar 2014 17:52:40 +0000 (21:52 +0400)
committerOleg Drokin <oleg.drokin@intel.com>
Fri, 11 Apr 2014 16:42:33 +0000 (16:42 +0000)
Don’t deploy init scripts if they are not supported,
for example on none RedHat systems.

Don’t deploy the "lustre" and "ha.d" init scripts on clients.

Fix typo in lustre/scripts/lnet script.

Signed-off-by: Dmitry Eremin <dmitry.eremin@intel.com>
Change-Id: I10be8e9e27ecfd2426d3e1ae8f40e1f7bf6d725d
Reviewed-on: http://review.whamcloud.com/9535
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Minh Diep <minh.diep@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre.spec.in
lustre/conf/Makefile.am
lustre/scripts/Makefile.am
lustre/scripts/lnet

index d00f609..fb757d8 100644 (file)
@@ -312,10 +312,25 @@ make install DESTDIR=$RPM_BUILD_ROOT
 # hack to avoid changing the libsysio code for "make install"
 rm -f $RPM_BUILD_ROOT%{_libdir}/libsysio.a
 
+:> lustre.files
+
+%if %{with servers}
 # 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%{_sysconfdir}/ha.d/resource.d/Lustre
+echo '%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2' >>lustre.files
+echo '%{_sysconfdir}/ha.d/resource.d/Lustre' >>lustre.files
+
+if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lustre ]; then
+       echo '%{_sysconfdir}/sysconfig/lustre' >>lustre.files
+       echo '%{_sysconfdir}/init.d/lustre' >>lustre.files
+fi
+%endif
+
+if [ -f $RPM_BUILD_ROOT%{_sysconfdir}/init.d/lnet ]; then
+       echo '%{_sysconfdir}/init.d/lnet' >>lustre.files
+fi
 
 # Create the pristine source directory.
 cd $RPM_BUILD_DIR/lustre-%{version}
@@ -327,8 +342,6 @@ chmod -R go-w lustre-source/lustre-%{version}
 # fc18 needs 'x' permission for library files
 find $RPM_BUILD_ROOT -name '*.so' | xargs chmod +x
 
-:> lustre.files
-
 if [ -f $RPM_BUILD_ROOT%{_libdir}/liblustre.so ] ; then
   echo '%{_libdir}/liblustre.a' >>lustre.files
   echo '%{_libdir}/liblustre.so' >>lustre.files
@@ -402,14 +415,9 @@ find $RPM_BUILD_ROOT%{?rootdir}/lib/modules/%{kversion}/%{kmoddir} -name "*.ko"
 %{_includedir}/libcfs
 %{_includedir}/linux/lustre_user.h
 %{_libexecdir}/lustre/lc_common
+%{_libexecdir}/lustre/haconfig
 %{_sysconfdir}/udev/rules.d/99-lustre.rules
-%{_sysconfdir}/init.d/lnet
-%{_sysconfdir}/init.d/lustre
 %config(noreplace) %{_sysconfdir}/ldev.conf
-%{_sysconfdir}/sysconfig/lustre
-%{_libexecdir}/lustre/haconfig
-%{_sysconfdir}/ha.d/resource.d/Lustre.ha_v2
-%{_sysconfdir}/ha.d/resource.d/Lustre
 
 %if %{with lustre_modules}
 %files modules
index 2f25ba2..5797eed 100644 (file)
@@ -46,7 +46,11 @@ endif
 udevrulesdir = $(sysconfdir)/udev/rules.d
 udevrules_DATA = 99-lustre.rules
 
+if INIT_SCRIPTS
+if SERVER
 sysconfigdir = $(sysconfdir)/sysconfig
 sysconfig_DATA = lustre
+endif
+endif
 
 sysconf_DATA = ldev.conf
index 7aa30d0..1235ca9 100644 (file)
@@ -41,11 +41,18 @@ sbinscripts += lustre_routes_config lustre_routes_conversion
 genscripts = lustre_config lc_modprobe lc_net lc_hb lc_cluman lustre_createcsv \
     lc_md lc_lvm lustre_start
 
+if INIT_SCRIPTS
 initdir = $(sysconfdir)/init.d
-init_SCRIPTS = lustre lnet
+init_SCRIPTS = lnet
+if SERVER
+init_SCRIPTS += lustre
+endif
+endif
 
+if SERVER
 hadir = $(sysconfdir)/ha.d/resource.d
 ha_SCRIPTS = Lustre.ha_v2
+endif
 
 sbin_SCRIPTS = $(genscripts) $(sbinscripts)
 bin_SCRIPTS = lustre_req_history lfs_migrate
index f4aacf3..ca3eaca 100644 (file)
@@ -6,7 +6,7 @@
 # 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