rpm: automatically load the fuse module on EL5

The fuse module needs to be loaded before /dev/fuse can be used. On
RHEL6 and Fedora the module is loaded on demand. RHEL5 needs to load the
module manually.

This change add a script under /etc/sysconfig/modules/ that loads the
fuse module on boot and packages it in the EL5 version of
glusterfs-fuse.

One of the features of GlusterFS is to not depend on additional fuse
userspace. The conditional requires on /usr/bin/fusermount is not
needed, this command is never called in the current version (even though
is it referenced in the sources).

Change-Id: I77028dade54771cb49cea68a517100f73763dc85
BUG: 947830
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/5070
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
This commit is contained in:
Niels de Vos 2013-05-22 16:20:36 +02:00 committed by Anand Avati
parent 4df7a3c488
commit 323fe9ec80
3 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,5 @@
EXTRA_DIST = glusterd-Debian glusterd-Redhat glusterd-SuSE glusterd.plist
EXTRA_DIST = glusterd-Debian glusterd-Redhat glusterd-SuSE glusterd.plist rhel5-load-fuse.modules
CLEANFILES =

View File

@ -0,0 +1,7 @@
#!/bin/sh
#
# fusermount-glusterfs requires the /dev/fuse character device. The fuse module
# provides this and is loaded on demand in newer Linux distributions.
#
[ -c /dev/fuse ] || /sbin/modprobe fuse

View File

@ -193,9 +193,6 @@ Group: Applications/File
BuildRequires: fuse-devel
Requires: %{name} = %{version}-%{release}
%if ! 0%{?_with_fusermount}
Requires: /usr/bin/fusermount
%endif
Obsoletes: %{name}-client < %{version}-%{release}
Provides: %{name}-client = %{version}-%{release}
@ -325,6 +322,11 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%{__rm} -f %{buildroot}%{_sysconfdir}/init.d/glusterd
%endif
%if 0%{?rhel} && 0%{?rhel} <= 5
%{__install} -D -p -m 0755 extras/init.d/rhel5-load-fuse.modules \
%{buildroot}%{_sysconfdir}/sysconfig/modules/glusterfs-fuse.modules
%endif
%{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterd
%{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterfs
%{__mkdir_p} %{buildroot}%{_localstatedir}/log/glusterfsd
@ -483,6 +485,9 @@ fi
%if 0%{!?_without_fusermount:1}
%{_bindir}/fusermount-glusterfs
%endif
%if 0%{?rhel} && 0%{?rhel} <= 5
%{_sysconfdir}/sysconfig/modules/glusterfs-fuse.modules
%endif
%files server
%defattr(-,root,root,-)