From 109e2da1b156cf038615513b838e18c8d6edf56f Mon Sep 17 00:00:00 2001 From: Dmitry Eremin Date: Thu, 6 Mar 2014 21:52:40 +0400 Subject: [PATCH] =?utf8?q?LU-4707=20build:=20Don=E2=80=99t=20deploy=20the?= =?utf8?q?=20"lustre"=20init=20script=20on=20clients?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Change-Id: I10be8e9e27ecfd2426d3e1ae8f40e1f7bf6d725d Reviewed-on: http://review.whamcloud.com/9535 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Minh Diep Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- lustre.spec.in | 24 ++++++++++++++++-------- lustre/conf/Makefile.am | 4 ++++ lustre/scripts/Makefile.am | 9 ++++++++- lustre/scripts/lnet | 2 +- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/lustre.spec.in b/lustre.spec.in index d00f609..fb757d8 100644 --- a/lustre.spec.in +++ b/lustre.spec.in @@ -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 diff --git a/lustre/conf/Makefile.am b/lustre/conf/Makefile.am index 2f25ba2..5797eed 100644 --- a/lustre/conf/Makefile.am +++ b/lustre/conf/Makefile.am @@ -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 diff --git a/lustre/scripts/Makefile.am b/lustre/scripts/Makefile.am index 7aa30d0..1235ca9 100644 --- a/lustre/scripts/Makefile.am +++ b/lustre/scripts/Makefile.am @@ -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 diff --git a/lustre/scripts/lnet b/lustre/scripts/lnet index f4aacf3..ca3eaca 100644 --- a/lustre/scripts/lnet +++ b/lustre/scripts/lnet @@ -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 -- 1.8.3.1