Package init

This commit is contained in:
overweight 2019-09-30 10:40:53 -04:00
commit 35bbff2249
9 changed files with 696 additions and 0 deletions

View File

@ -0,0 +1,38 @@
From a0a0afc59bb1d2deddfdb776bc9e49e02f58ce32 Mon Sep 17 00:00:00 2001
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
Date: Tue, 24 Jul 2018 14:40:51 -0400
Subject: [PATCH] georep: fix hard-coded paths in gsyncd.conf.in
Why anyone puts a hard-coded path like /usr/local/sbin in a
config file is beyond me.
I wonder how many more are lurking in our sources
Change-Id: I6523894416cc06236ea1f99529efd36e957bd98e
updates: bz#1193929
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
---
geo-replication/gsyncd.conf.in | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/geo-replication/gsyncd.conf.in b/geo-replication/gsyncd.conf.in
index 0a842cf2b..bd04400ff 100644
--- a/geo-replication/gsyncd.conf.in
+++ b/geo-replication/gsyncd.conf.in
@@ -138,11 +138,11 @@ value =
help=If SSH keys are not secured with gsyncd prefix then use this configuration to set the actual path of gsyncd(Usually /usr/libexec/glusterfs/gsyncd)
[gluster-command-dir]
-value=/usr/local/sbin/
+value=@SBIN_DIR@
help=Directory where Gluster binaries exist on master
[slave-gluster-command-dir]
-value=/usr/local/sbin/
+value=@SBIN_DIR@
help=Directory where Gluster binaries exist on slave
[gluster-params]
--
2.17.1

6
glusterd.sysconfig Normal file
View File

@ -0,0 +1,6 @@
# Change the glusterd service defaults here.
# See "glusterd --help" outpout for defaults and possible values.
#GLUSTERD_LOGFILE="/var/log/gluster/gluster.log"
#GLUSTERD_LOGLEVEL="NORMAL"

BIN
glusterfs-4.1.5.tar.gz Normal file

Binary file not shown.

484
glusterfs.spec Normal file
View File

@ -0,0 +1,484 @@
%global _hardened_build 1
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
Name: glusterfs
Version: 4.1.5
Release: 3
License: GPLv2 and LGPLv3+
Summary: Aggregating distributed file system
URL: http://docs.gluster.org/
Source0: http://download.gluster.org/pub/gluster/%{name}/4.1/%{version}/%{name}-%{version}.tar.gz
Patch0: python.patch
Patch1: 0001-georep-fix-hard-coded-paths-in-gsyncd.conf.in.patch
Source1: glusterd.sysconfig
Source2: glusterfsd.sysconfig
Source6: load-fuse-modules
Source7: glusterfsd.service
Source8: glusterfsd.init
BuildRequires: systemd bison flex gcc make libtool ncurses-devel readline-devel libattr-devel
BuildRequires: libxml2-devel openssl-devel libaio-devel libacl-devel python2-devel git perl
BuildRequires: libtirpc-devel rpcgen libuuid-devel sqlite-devel lvm2-devel firewalld
BuildRequires: fuse-devel libibverbs-devel
BuildRequires: userspace-rcu-devel >= 0.7
BuildRequires: libcmocka-devel >= 1.0.1
BuildRequires: librdmacm-devel >= 1.0.15
Obsoletes: glusterfs-regression-tests hekafs glusterfs-ufo glusterfs-ganesha
Obsoletes: %{name}-common < %{version}-%{release}
Obsoletes: %{name}-core < %{version}-%{release}
Provides: %{name}-common = %{version}-%{release}
Provides: %{name}-core = %{version}-%{release}
Requires: python2-gluster = %{version}-%{release}
Requires: python2 python2-prettytable python-requests attr psmisc rsync
Requires: rpcbind pyxattr lvm2 nfs-utils
Requires(pre): shadow-utils
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
Provides: %{name}-api
Obsoletes: %{name}-api
Provides: %{name}-cli
Obsoletes: %{name}-cli
Provides: %{name}-events
Obsoletes: %{name}-events
Provides: %{name}-client-xlators
Obsoletes: %{name}-client-xlators
Provides: %{name}-extra-xlators
Obsoletes: %{name}-extra-xlators
Provides: %{name}-fuse
Obsoletes: %{name}-fuse
Obsoletes: %{name}-client < %{version}-%{release}
Provides: %{name}-client = %{version}-%{release}
Provides: %{name}-gnfs
Obsoletes: %{name}-gnfs
Provides: %{name}-geo-replication
Obsoletes: %{name}-geo-replication
Provides: %{name}-libs
Obsoletes: %{name}-libs
Provides: %{name}-rdma
Obsoletes: %{name}-rdma
Provides: %{name}-server
Obsoletes: %{name}-server
%description
GlusterFS is a scalable network filesystem suitable for data-intensive tasks such as cloud storage
and media streaming.
%package devel
Summary: Development files for glusterfs
Provides: %{name}-api-devel
Obsoletes: %{name}-api-devel
Requires: %{name} = %{version}-%{release}
Requires: %{name}-extra-xlators = %{version}-%{release}
Requires: libacl-devel
%description devel
This package provides the development libraries and include files.
%package -n python-gluster
Summary: GlusterFS python library
BuildArch: noarch
%description -n python-gluster
This package contains the python modules of GlusterFS and own gluster namespace.
%package -n python2-gluster
Summary: GlusterFS python library
%{?python_provide:%python_provide python2-gluster}
Provides: python-gluster = %{version}-%{release}
Obsoletes: python-gluster < 3.10
Requires: python2
%description -n python2-gluster
This package contains the python2 modules of GlusterFS and own gluster namespace.
%package help
Summary: Including man files for glusterfs.
Requires: man
%package resource-agents
Summary: OCF-compliant resource agents for GlusterFS
License: GPLv3+
BuildArch: noarch
Requires: %{name}-server = %{version}-%{release}
Requires: %{_prefix}/lib/ocf/resource.d
%description resource-agents
Resource agents for monitoring and managing glusterd daemons
under Open Cluster Framework (OCF) compliant resource
managers such as Pacemaker.
%description help
This contains man files for the using of glusterfs.
%prep
%autosetup -Sgit -n %{name}-%{version}
%build
sed -i -e 's/--quiet//' configure.ac
./autogen.sh && %configure \
--enable-firewalld \
--enable-gnfs \
--with-tmpfilesdir=%{_tmpfilesdir}
#hardening and rpath
sed -i 's| \\\$compiler_flags |&\\\$LDFLAGS |' libtool
%disable_rpath
%make_build V=1
%check
make check
%install
rm -rf %{buildroot}
make install DESTDIR=%{buildroot} docdir="%_docdir/%name"
%delete_la_and_a
install -p -m 0644 contrib/uuid/*.h %{buildroot}%{_includedir}/glusterfs/
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/glusterd
install -D -p -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/glusterfsd
mkdir -p %{buildroot}%{_localstatedir}/log/{glusterd,glusterfs,glusterfsd}
mkdir -p %{buildroot}%{_rundir}/gluster/metrics
#new working directory
mkdir -p %{buildroot}%{_localstatedir}/lib/glusterd
# change the configuration file for the new working directory
perl -i -pe \
's{^(\s*option working-directory )\S+}{$1 %{_localstatedir}/lib/glusterd}g' \
"%{buildroot}/%{_sysconfdir}/%name/glusterd.vol"
# glusterfsd.service
install -D -p -m 0644 %{_sourcedir}/glusterfsd.service %{buildroot}%{_unitdir}/glusterfsd.service
install -D -p -m 0644 extras/glusterfs-logrotate %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs
#ghosts
install -d %{buildroot}%{_localstatedir}/lib/glusterd/geo-replication
touch %{buildroot}%{_localstatedir}/lib/glusterd/geo-replication/gsyncd_template.conf
install -D -p -m 0644 extras/glusterfs-georep-logrotate %{buildroot}%{_sysconfdir}/logrotate.d/glusterfs-georep
touch %{buildroot}%{_localstatedir}/lib/glusterd/glusterd.info
touch %{buildroot}%{_localstatedir}/lib/glusterd/options
subdirs=(add-brick create copy-file delete gsync-create remove-brick reset set start stop)
for dir in ${subdirs[@]}; do
mkdir -p %{buildroot}%{_localstatedir}/lib/glusterd/hooks/1/"$dir"/{pre,post}
done
install -d %{buildroot}%{_localstatedir}/lib/glusterd/{glustershd,peers,vols,nfs/run,bitd,quotad,scrub,snaps,ss_brick}
touch %{buildroot}%{_localstatedir}/lib/glusterd/nfs/nfs-server.vol
touch %{buildroot}%{_localstatedir}/lib/glusterd/nfs/run/nfs.pid
#cli
install -p -m 0755 -D extras/command-completion/gluster.bash %{buildroot}%{_sysconfdir}/bash_completion.d/gluster
%post
/sbin/ldconfig
%systemd_postun_with_restart rsyslog
%systemd_post glustereventsd
if [ $1 -ge 1 ]; then
%systemd_postun_with_restart glusterd
fi
%systemd_post glusterd
%systemd_post glusterfsd
if [ -f %{_localstatedir}/log/glusterfs/.cmd_log_history ]; then
mv %{_localstatedir}/log/glusterfs/.cmd_log_history \
%{_localstatedir}/log/glusterfs/cmd_history.log
fi
if [ -d /etc/glusterd -a ! -h %{_localstatedir}/lib/glusterd ]; then
install -d %{_localstatedir}/lib/glusterd
cp -a /etc/glusterd %{_localstatedir}/lib/glusterd
rm -rf /etc/glusterd
ln -sf %{_localstatedir}/lib/glusterd /etc/glusterd
fi
if [ -d %{_localstatedir}/lib/glusterd/vols ]; then
for file in $(find %{_localstatedir}/lib/glusterd/vols -name '*.vol'); do
newfile=${file}.rpmsave
echo "warning: ${file} saved as ${newfile}"
cp ${file} ${newfile}
done
fi
if [ -e /etc/ld.so.conf.d/glusterfs.conf ]; then
rm -f /etc/ld.so.conf.d/glusterfs.conf
fi
%firewalld_reload
pidof -c -o %PPID -x glusterd &> /dev/null
if [ $? -eq 0 ]; then
kill -9 `pgrep -f gsyncd.py` &> /dev/null
killall --wait glusterd &> /dev/null
glusterd --xlator-option *.upgrade=on -N
rm -f %{_rundir}/glusterd.socket
/bin/systemctl --quiet start glusterd.service
else
glusterd --xlator-option *.upgrade=on -N
rm -f %{_rundir}/glusterd.socket
fi
exit 0
%pre
getent group gluster > /dev/null || groupadd -r gluster
getent passwd gluster > /dev/null || useradd -r -g gluster -d %{_rundir}/gluster -s /sbin/nologin -c "GlusterFS daemons" gluster
exit 0
%preun
if [ $1 -eq 0 ]; then
if [ -f %{_unitdir}/glustereventsd.service ]; then
/bin/systemctl --quiet stop glustereventsd.service
%systemd_preun glustereventsd
fi
if [ -f %{_unitdir}/glusterfsd.service ]; then
/bin/systemctl --quiet stop glusterfsd.service
fi
/bin/systemctl --quiet stop glusterd.service
if [ -f %{_unitdir}/glusterfsd.service ]; then
%systemd_preun glusterfsd
fi
%systemd_preun glusterd
fi
if [ $1 -ge 1 ]; then
if [ -f %{_unitdir}/glusterfsd.service ]; then
%systemd_postun_with_restart glusterfsd
fi
%systemd_postun_with_restart glusterd
fi
exit 0
%postun
/sbin/ldconfig
%systemd_postun_with_restart rsyslog
%firewalld_reload
exit 0
%files
%license COPYING-GPLV2 COPYING-LGPLV3
%doc extras/clear_xattrs.sh
%_docdir/%name
%dir %{_localstatedir}/log/glusterfs
%dir %{_datadir}/glusterfs
%dir %{_datadir}/glusterfs/scripts
%{_datadir}/glusterfs/scripts/*
%dir %{_libdir}/glusterfs
%dir %{_libdir}/glusterfs/%{version}
%dir %{_libdir}/glusterfs/%{version}/auth
%{_libdir}/glusterfs/%{version}/auth/*
%dir %{_libdir}/glusterfs/%{version}/rpc-transport
%{_libdir}/glusterfs/%{version}/rpc-transport/*
%dir %{_libdir}/glusterfs/%{version}/xlator
%dir %{_libdir}/glusterfs/%{version}/xlator/debug
%{_libdir}/glusterfs/%{version}/xlator/debug/*
%dir %{_libdir}/glusterfs/%{version}/xlator/encryption
%{_libdir}/glusterfs/%{version}/xlator/encryption/*
%dir %{_libdir}/glusterfs/%{version}/xlator/features
%{_libdir}/glusterfs/%{version}/xlator/features/posix*
%{_libdir}/glusterfs/%{version}/xlator/features/quota*
%{_libdir}/glusterfs/%{version}/xlator/features/*.so
%{_libdir}/glusterfs/%{version}/xlator/meta.so
%dir %{_libdir}/glusterfs/%{version}/xlator/performance
%{_libdir}/glusterfs/%{version}/xlator/performance/*.so
%dir %{_libdir}/glusterfs/%{version}/xlator/system
%{_libdir}/glusterfs/%{version}/xlator/system/*
%dir %attr(0775,gluster,gluster) %{_rundir}/gluster
%dir %attr(0775,gluster,gluster) %{_rundir}/gluster/metrics
%{_tmpfilesdir}/gluster.conf
%exclude %{_libdir}/*.so
%dir %{_libdir}/glusterfs/%{version}/xlator/mount
%{_libdir}/glusterfs/%{version}/xlator/mount/*.so
%{_sbindir}/gluster
%{_sysconfdir}/bash_completion.d/gluster
%dir %{_libdir}/glusterfs/%{version}/xlator/cluster
%{_libdir}/glusterfs/%{version}/xlator/cluster/*.so
%dir %{_libdir}/glusterfs/%{version}/xlator/testing
%dir %{_libdir}/glusterfs/%{version}/xlator/testing/features
%{_libdir}/glusterfs/%{version}/xlator/testing/features/template.so
%dir %{_libdir}/glusterfs/%{version}/xlator/testing/performance
%{_libdir}/glusterfs/%{version}/xlator/testing/performance/symlink-cache.so
# Glupy Python files
%dir %{python2_sitelib}/gluster
%dir %{python2_sitelib}/gluster/glupy
%{python2_sitelib}/gluster/glupy/*
%{_sbindir}/glusterfs
%{_sbindir}/glusterfsd
%{_bindir}/fusermount-glusterfs
/sbin/mount.glusterfs
%config(noreplace) %{_sysconfdir}/logrotate.d/glusterfs
%dir %{_libdir}/glusterfs/%{version}/xlator/nfs
%{_libdir}/glusterfs/%{version}/xlator/nfs/*
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/nfs
%ghost %attr(0600,-,-) %{_localstatedir}/lib/glusterd/nfs/nfs-server.vol
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/nfs/run
%ghost %attr(0600,-,-) %{_localstatedir}/lib/glusterd/nfs/run/nfs.pid
%config(noreplace) %{_sysconfdir}/logrotate.d/glusterfs-georep
%{_sbindir}/gfind_missing_files
%{_sbindir}/gluster-mountbroker
%dir %{_libexecdir}/glusterfs
%dir %{_libexecdir}/glusterfs/python
%dir %{_libexecdir}/glusterfs/python/syncdaemon
%{_libexecdir}/glusterfs/python/syncdaemon/*
%dir %{_libexecdir}/glusterfs/events
%{_libexecdir}/glusterfs/events/*
%{_libexecdir}/glusterfs/gsyncd
%{_libexecdir}/glusterfs/gverify.sh
%{_libexecdir}/glusterfs/set_geo_rep_pem_keys.sh
%{_libexecdir}/glusterfs/peer_gsec_create
%{_libexecdir}/glusterfs/peer_mountbroker
%{_libexecdir}/glusterfs/peer_mountbroker.py*
%{_libexecdir}/glusterfs/gfind_missing_files
%{_libexecdir}/glusterfs/peer_georep-sshkey.py*
%{_libexecdir}/glusterfs/mount-shared-storage.sh
%{_libexecdir}/glusterfs/glusterfind
%{_libexecdir}/glusterfs/peer_add_secret_pub
%{_libexecdir}/glusterfs/peer_eventsapi.py*
%{_sbindir}/gluster-georep-sshkey
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/geo-replication
%ghost %attr(0644,-,-) %{_localstatedir}/lib/glusterd/geo-replication/gsyncd_template.conf
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/gsync-create
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/gsync-create/post
%attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/gsync-create/post/S56glusterd-geo-rep-create-post.sh
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/gsync-create/pre
%{_libdir}/*.so.*
# sysconf
%config(noreplace) %{_sysconfdir}/glusterfs
%config(noreplace) %{_sysconfdir}/sysconfig/glusterd
%config(noreplace) %{_sysconfdir}/sysconfig/glusterfsd
# init files
%{_unitdir}/glusterd.service
%{_unitdir}/glusterfsd.service
%{_unitdir}/glusterfssharedstorage.service
# binaries
%{_sbindir}/glusterd
%{_sbindir}/glfsheal
%{_sbindir}/gf_attach
%{_sbindir}/gluster-setgfid2path
%{_libdir}/libgfdb.so.*
%dir %{_libdir}/glusterfs/%{version}/xlator/mgmt
%{_libdir}/glusterfs/%{version}/xlator/mgmt/*.so
%dir %{_libdir}/glusterfs/%{version}/xlator/protocol
%{_libdir}/glusterfs/%{version}/xlator/protocol/*.so
%dir %{_libdir}/glusterfs/%{version}/xlator/storage
%{_libdir}/glusterfs/%{version}/xlator/storage/bd.so
%exclude %{_prefix}/lib/debug%{_libdir}/glusterfs/%{version}/xlator/storage/bd.so*debug
%{_libdir}/glusterfs/%{version}/xlator/storage/posix.so
# snap_scheduler
%{_sbindir}/snap_scheduler.py
%{_sbindir}/gcron.py
%{_sbindir}/conf.py
#/var/lib/glusterd,hookscript,etc.
%ghost %attr(0644,-,-) %config(noreplace) %{_localstatedir}/lib/glusterd/glusterd.info
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/bitd
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/groups
%attr(0644,-,-) %{_localstatedir}/lib/glusterd/groups/*
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/glusterfind
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/glusterfind/.keys
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/glustershd
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/add-brick
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/add-brick/post
%attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/add-brick/post/*
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/add-brick/pre
%attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/add-brick/pre/*
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/create
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/create/post
%attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/create/post/*
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/create/pre
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/copy-file
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/copy-file/post
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/copy-file/pre
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/delete
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/delete/post
%{_localstatedir}/lib/glusterd/hooks/1/delete/post/*
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/delete/pre
%attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/delete/pre/*
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/remove-brick
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/remove-brick/post
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/remove-brick/pre
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/reset
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/reset/post
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/reset/pre
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/set
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/set/post
%attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/set/post/*
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/set/pre
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/start
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/start/post
%attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/start/post/*
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/start/pre
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/stop
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/stop/post
%dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/stop/pre
%attr(0755,-,-) %{_localstatedir}/lib/glusterd/hooks/1/stop/pre/*
%config(noreplace) %ghost %attr(0600,-,-) %{_localstatedir}/lib/glusterd/options
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/peers
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/quotad
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/scrub
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/snaps
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/ss_brick
%ghost %dir %attr(0755,-,-) %{_localstatedir}/lib/glusterd/vols
%{_bindir}/glusterfind
%{_prefix}/lib/firewalld/services/glusterfs.xml
%config(noreplace) %{_sysconfdir}/glusterfs/eventsconfig.json
%dir %{_localstatedir}/lib/glusterd/events
%{_sbindir}/glustereventsd
%{_sbindir}/gluster-eventsapi
%{_unitdir}/glustereventsd.service
%files -n python2-gluster
%dir %{python2_sitelib}/gluster
%{python2_sitelib}/gluster/__init__.*
%{python2_sitelib}/gluster/cliutils
%files devel
%dir %{_includedir}/glusterfs
%{_includedir}/glusterfs/*
%{_libdir}/*.so
%dir %{_libdir}/glusterfs/%{version}/xlator/features
%dir %{_libdir}/glusterfs/%{version}/xlator/features/glupy
%{_libdir}/glusterfs/%{version}/xlator/features/glupy/*
%{_libdir}/pkgconfig/*.pc
%{_libdir}/libgfapi.so
%dir %{_includedir}/glusterfs/api
%{_includedir}/glusterfs/api/*
%files resource-agents
%{_prefix}/lib/ocf/resource.d/glusterfs
%files help
%{_mandir}/man8/*gluster*.8*
%changelog
* Sat Sep 21 2019 zoujing<zoujing13@huawei.com> - 4.1.5-3
- Type:enhancemnet
- ID:NA
- SUG:NA
- DESC:split the glusterfs-resource-agents
* Mon Sep 16 2019 zoujing<zoujing13@huawei.com> - 4.1.5-2
- Package init

107
glusterfsd.init Normal file
View File

@ -0,0 +1,107 @@
#!/bin/sh
#
# glusterfsd Startup script for the glusterfs server
#
# chkconfig: - 20 80
# description: Clustered file-system server
### BEGIN INIT INFO
# Provides: glusterfsd
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Should-Start:
# Should-Stop:
# Default-Start:
# Default-Stop: 0 1 2 3 4 5 6
# Short-Description: glusterfs server
# Description: Clustered file-system server
### END INIT INFO
# Source function library.
. /etc/rc.d/init.d/functions
exec="/usr/sbin/glusterfsd"
prog="glusterfsd"
# Set defaults, then source config for eventual overrides
GLUSTERFSD_NOFILE="65536"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
lockfile=/var/lock/subsys/$prog
start() {
[ -x $exec ] || exit 5
[ $GLUSTERFSD_CONFIG -a -f $GLUSTERFSD_CONFIG ] || exit 6
ulimit -n $GLUSTERFSD_NOFILE
echo -n $"Starting $prog: "
daemon $exec${GLUSTERFSD_CONFIG+" -f $GLUSTERFSD_CONFIG"}${GLUSTERFSD_LOGFILE+" -l $GLUSTERFSD_LOGFILE"}${GLUSTERFSD_LOGLEVEL+" -L $GLUSTERFSD_LOGLEVEL"} -p /var/run/glusterfsd.pid
retval=$?
echo
[ $retval -eq 0 ] && touch $lockfile
return $retval
}
stop() {
echo -n $"Stopping $prog: "
killproc $prog
retval=$?
echo
[ $retval -eq 0 ] && rm -f $lockfile
return $retval
}
restart() {
stop
start
}
reload() {
restart
}
force_reload() {
restart
}
rh_status() {
status $prog
}
rh_status_q() {
rh_status &>/dev/null
}
case "$1" in
start)
rh_status_q && exit 0
$1
;;
stop)
rh_status_q || exit 0
$1
;;
restart)
$1
;;
reload)
rh_status_q || exit 7
$1
;;
force-reload)
force_reload
;;
status)
rh_status
;;
condrestart|try-restart)
rh_status_q || exit 0
restart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}"
exit 2
esac
exit $?

16
glusterfsd.service Normal file
View File

@ -0,0 +1,16 @@
[Unit]
Description=GlusterFS brick processes (stopping only)
After=network.target glusterd.service
[Service]
Type=oneshot
# glusterd starts the glusterfsd processed on-demand
# /bin/true will mark this service as started, RemainAfterExit keeps it active
ExecStart=/bin/true
RemainAfterExit=yes
# if there are no glusterfsd processes, a stop/reload should not give an error
ExecStop=/bin/sh -c "/bin/killall --wait glusterfsd || /bin/true"
ExecReload=/bin/sh -c "/bin/killall -HUP glusterfsd || /bin/true"
[Install]
WantedBy=multi-user.target

6
glusterfsd.sysconfig Normal file
View File

@ -0,0 +1,6 @@
# Change the glusterfsd service defaults here.
# See "glusterfsd --help" outpout for defaults and possible values.
#GLUSTERFSD_CONFIG="/etc/glusterfs/glusterfsd.vol"
#GLUSTERFSD_LOGFILE="/var/log/glusterfs/glusterfs.log"
#GLUSTERFSD_LOGLEVEL="NORMAL"

7
load-fuse-modules Executable file
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

32
python.patch Normal file
View File

@ -0,0 +1,32 @@
--- glusterfs-4.1.1/xlators/features/utime/src/utime-gen-fops-c.py.orig 2018-07-11 09:40:35.166390285 -0400
+++ glusterfs-4.1.1/xlators/features/utime/src/utime-gen-fops-c.py 2018-07-11 09:41:00.743390285 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
import os
import sys
--- glusterfs-4.1.1/xlators/features/utime/src/utime-gen-fops-h.py.orig 2018-07-11 09:40:49.035390285 -0400
+++ glusterfs-4.1.1/xlators/features/utime/src/utime-gen-fops-h.py 2018-07-11 09:41:06.015390285 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
import os
import sys
--- glusterfs-4.1.1/xlators/features/cloudsync/src/cloudsync-fops-c.py.orig 2018-07-11 09:41:30.646390285 -0400
+++ glusterfs-4.1.1/xlators/features/cloudsync/src/cloudsync-fops-c.py 2018-07-11 09:41:53.033390285 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
from __future__ import print_function
import os
--- glusterfs-4.1.1/xlators/features/cloudsync/src/cloudsync-fops-h.py.orig 2018-07-11 09:41:38.198390285 -0400
+++ glusterfs-4.1.1/xlators/features/cloudsync/src/cloudsync-fops-h.py 2018-07-11 09:41:55.423390285 -0400
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/python2
from __future__ import print_function
import os