diff options
author | Jeff Darcy <jdarcy@fb.com> | 2017-12-05 13:06:02 -0800 |
---|---|---|
committer | Jeff Darcy <jdarcy@fb.com> | 2017-12-20 09:40:19 -0800 |
commit | 21e9d065b779841cc161975ff2b66e8ce27dddbe (patch) | |
tree | 237366d29cbc545b3dba6fadd986075e1377fa04 | |
parent | b8caf1e774a9d8f52a6c630d687313c94aaec3c0 (diff) |
build: many rpm-build fixes
Summary:
Highlights include:
* Fixed GF_CONF_OPTS (dev builds) and RPM_BUILD_FLAGS (rpm builds)
* Fixed version in configure.ac
* Fixed handling of files only present when BUILD_FB_EXTRAS is set
* Fixed disable-georeplication (upstream bug)
* Fixed disable-tiering (upstream bug)
* Removed .service files which should be generated from .in versions
* Fixed tirpc (previously fbtirpc) references
* Fixed init_enable problems
* Removed delay-gen references
Test Plan: Use build.sh to build an RPM, and install it.
Differential Revision: https://phabricator.intern.facebook.com/D6611299
Change-Id: If61a4964a149f782038ea47362a82b813e6b7738
Signed-off-by: Jeff Darcy <jdarcy@fb.com>
-rw-r--r-- | build_env | 2 | ||||
-rwxr-xr-x | buildrpm38.sh | 6 | ||||
-rw-r--r-- | configure.ac | 30 | ||||
-rw-r--r-- | extras/init.d/Makefile.am | 18 | ||||
-rw-r--r-- | extras/systemd/glusterd-gfproxyd.service | 16 | ||||
-rw-r--r-- | extras/systemd/glusterd-mgmt.service | 15 | ||||
-rw-r--r-- | extras/systemd/glusterd-mgmt.service.in | 2 | ||||
-rw-r--r-- | extras/systemd/glusterd-nfsd.service | 16 | ||||
-rw-r--r-- | extras/systemd/glusterd-shd.service | 17 | ||||
-rw-r--r-- | extras/systemd/glustereventsd.service | 14 | ||||
-rw-r--r-- | extras/systemd/glusterfssharedstorage.service | 13 | ||||
-rw-r--r-- | glusterfs.spec.in | 66 | ||||
-rw-r--r-- | xlators/features/changetimerecorder/src/Makefile.am | 2 |
13 files changed, 73 insertions, 144 deletions
diff --git a/build_env b/build_env index 46cb18fdd89..addc0e4e251 100644 --- a/build_env +++ b/build_env @@ -10,7 +10,7 @@ GF_CONF_OPTS="--localstatedir=/var --sysconfdir /var/lib --prefix /usr --libdir /usr/lib64 \ --enable-fusermount --enable-api --with-jemalloc \ - --with-ipv6-default --with-fbextras --disable-tiering" + --with-ipv6-default --with-fbextras --disable-tiering --disable-georeplication" if [ -x /usr/lib/rpm/redhat/dist.sh ]; then REDHAT_MAJOR=$(/usr/lib/rpm/redhat/dist.sh --distnum) diff --git a/buildrpm38.sh b/buildrpm38.sh index 45f25da7a51..cee818b2794 100755 --- a/buildrpm38.sh +++ b/buildrpm38.sh @@ -86,7 +86,11 @@ echo DONE MY_TARBALL=~/local/rpmbuild/glusterfs-3.8.15_fb.tar.gz cp $(basename $MY_TARBALL) $MY_TARBALL -MY_RPM_BUILD_FLAGS="--with fbextras --without georeplication" +# These flags have a different syntax when passed through rpmbuild than when +# passed directly to configure, but please keep them in sync with GF_CONF_OPTS +# in build_env. +MY_RPM_BUILD_FLAGS="--with jemalloc --with ipv6-default --with fbextras \ + --with fusermount --with api --without tiering --without georeplication" ALL_RPM_BUILD_FLAGS="$MY_RPM_BUILD_FLAGS $EXTRA_RPM_BUILD_FLAGS" if ! $RPMBUILD_BIN -tb $MY_TARBALL $ALL_RPM_BUILD_FLAGS; then exit 1 diff --git a/configure.ac b/configure.ac index fe4ff5c1daa..0b5f415cf0a 100644 --- a/configure.ac +++ b/configure.ac @@ -6,7 +6,7 @@ dnl General Public License, version 3 or any later version (LGPLv3 or dnl later), or the GNU General Public License, version 2 (GPLv2), in all dnl cases as published by the Free Software Foundation. -AC_INIT([glusterfs],[3.8_fb], +AC_INIT([glusterfs],[3.8.15_fb], [gluster-users@gluster.org],,[https://github.com/gluster/glusterfs.git]) AC_SUBST([PACKAGE_RELEASE], @@ -105,8 +105,6 @@ AC_CONFIG_FILES([Makefile xlators/debug/trace/src/Makefile xlators/debug/error-gen/Makefile xlators/debug/error-gen/src/Makefile - xlators/debug/delay-gen/Makefile - xlators/debug/delay-gen/src/Makefile xlators/debug/io-stats/Makefile xlators/debug/io-stats/src/Makefile xlators/protocol/Makefile @@ -206,7 +204,6 @@ AC_CONFIG_FILES([Makefile extras/init.d/glusterd-FreeBSD extras/init.d/glusterd-SuSE extras/init.d/glusterd-FbRedhat - extras/init.d/glusterd.functions-FbRedhat extras/ganesha/Makefile extras/ganesha/config/Makefile extras/ganesha/scripts/Makefile @@ -263,12 +260,6 @@ AC_CONFIG_FILES([Makefile tests/basic/fuse/Makefile tests/basic/gfapi/Makefile]) -if test "xBUILD_FBEXTRAS" = "xyes"; then -AC_CONFIG_FILES([ - xlators/mount/fuse/utils/umount.fuse.glusterfs - ]) -fi - AC_CANONICAL_HOST AC_PROG_CC @@ -295,9 +286,16 @@ fi AC_ARG_WITH([fbextras], AC_HELP_STRING([--with-fbextras], - [Enable Facebook specific extras.])) + [Enable Facebook specific extras.]), + [with_fbextras="${withval}"], + [with_fbextras="no"]) + if test "x$with_fbextras" = "xyes"; then BUILD_FBEXTRAS=yes + AC_CONFIG_FILES([ + xlators/mount/fuse/utils/umount.fuse.glusterfs + extras/init.d/glusterd.functions-FbRedhat + ]) else BUILD_FBEXTRAS=no fi @@ -710,14 +708,11 @@ AC_SUBST(RDMA_SUBDIR) # SYNCDAEMON section -enable_georeplication=yes AC_ARG_ENABLE([georeplication], AC_HELP_STRING([--disable-georeplication], [Do not install georeplication components]), - [enable_georeplication=no],[]) - -echo "enable_georeplication=$enable_georeplication" -enable_georeplication=no + [enable_georeplication="${enableval}"], + [enable_georeplication="yes"]) BUILD_SYNCDAEMON=no case $host_os in @@ -798,7 +793,7 @@ AM_CONDITIONAL([USE_FIREWALLD],test ["x${BUILD_FIREWALLD}" = "xyes"]) AC_ARG_ENABLE([tiering], AC_HELP_STRING([--disable-tiering], [Disable data classification/tiering]), - [BUILD_GFDB="${enableval}"], [BUILD_GFDB="yes"]) + [BUILD_GFDB="no"], [BUILD_GFDB="yes"]) case $host_os in darwin*) @@ -1400,6 +1395,7 @@ AM_CONDITIONAL([GF_BSD_HOST_OS], test "${GF_HOST_OS}" = "GF_BSD_HOST_OS") AM_CONDITIONAL([GF_FBEXTRAS], test "${BUILD_FBEXTRAS}" = "yes") AM_CONDITIONAL([GF_WITH_SYSTEMD], test "${WITH_SYSTEMD}" = "1") AC_SUBST(WITH_SYSTEMD) +AC_SUBST(BUILD_FBEXTRAS) AC_SUBST(GLUSTERD_WORKDIR) AM_CONDITIONAL([GF_INSTALL_GLUSTERD_WORKDIR], test ! -d ${GLUSTERD_WORKDIR} && test -d ${sysconfdir}/glusterd ) diff --git a/extras/init.d/Makefile.am b/extras/init.d/Makefile.am index 8c43e513d77..e6a02548dd7 100644 --- a/extras/init.d/Makefile.am +++ b/extras/init.d/Makefile.am @@ -7,11 +7,21 @@ INIT_DIR = @initdir@ SYSTEMD_DIR = @systemddir@ LAUNCHD_DIR = @launchddir@ +install-glusterd: + $(mkdir_p) $(DESTDIR)$(INIT_DIR) + $(INSTALL_PROGRAM) glusterd-$(GF_DISTRIBUTION) $(DESTDIR)$(INIT_DIR)/glusterd + +install-glusterd-functions: +if GF_FBEXTRAS + $(INSTALL_PROGRAM) glusterd.functions-$(GF_DISTRIBUTION) $(DESTDIR)$(INIT_DIR)/glusterd.functions +endif + +if GF_WITH_SYSTEMD $(GF_DISTRIBUTION): - @if [ ! -d $(SYSTEMD_DIR) ]; then \ - $(mkdir_p) $(DESTDIR)$(INIT_DIR); \ - $(INSTALL_PROGRAM) glusterd-$(GF_DISTRIBUTION) $(DESTDIR)$(INIT_DIR)/glusterd; \ - fi + @echo Using systemd, null installation +else +$(GF_DISTRIBUTION): install-glusterd install-glusterd-functions +endif install-exec-local: $(GF_DISTRIBUTION) diff --git a/extras/systemd/glusterd-gfproxyd.service b/extras/systemd/glusterd-gfproxyd.service deleted file mode 100644 index 051181fff34..00000000000 --- a/extras/systemd/glusterd-gfproxyd.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=GlusterFS GFProxy Daemon -After=network.target rpcbind.service -Before=network-online.target - -[Service] -Type=forking -EnvironmentFile=/var/lib/glusterd/glusterd.info -ExecStartPre=/bin/mkdir -p /var/lib/glusterd/gfproxy/run -ExecStart=/usr/sbin/glusterfs -s localhost --volfile-id gfproxy/groot -p /var/lib/glusterd/gfproxy/run/gfproxy.pid -l /var/log/glusterfs/gfproxyd.log -S /var/lib/glusterd/gfproxy/run/${UUID}.socket -PIDFile=/var/lib/glusterd/gfproxy/run/gfproxy.pid -ExecStop='pkill -f '^/usr/sbin/glusterfs.*gluster/gfproxy'' -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/extras/systemd/glusterd-mgmt.service b/extras/systemd/glusterd-mgmt.service deleted file mode 100644 index 62352137413..00000000000 --- a/extras/systemd/glusterd-mgmt.service +++ /dev/null @@ -1,15 +0,0 @@ -[Unit] -Description=GlusterFS Management Daemon -After=network.target rpcbind.service -Before=network-online.target - -[Service] -Type=forking -PIDFile=/var/lib/glusterd/run/glusterd.pid -LimitNOFILE=65536 -ExecStart=/usr/sbin/glusterd -p /var/lib/glusterd/run/glusterd.pid --skip-shd-start --skip-nfsd-start -KillMode=process -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/extras/systemd/glusterd-mgmt.service.in b/extras/systemd/glusterd-mgmt.service.in index 5e6e3911a0a..98e3a90d954 100644 --- a/extras/systemd/glusterd-mgmt.service.in +++ b/extras/systemd/glusterd-mgmt.service.in @@ -7,7 +7,7 @@ Before=network-online.target Type=forking PIDFile=@localstatedir@/lib/glusterd/run/glusterd.pid LimitNOFILE=65536 -ExecStart=@prefix@/sbin/glusterd -p @localstatedir@/lib/glusterd/run/glusterd.pid --skip-shd-start --skip-nfsd-start +ExecStart=@prefix@/sbin/glusterd -p @localstatedir@/lib/glusterd/run/glusterd.pid KillMode=process Restart=always diff --git a/extras/systemd/glusterd-nfsd.service b/extras/systemd/glusterd-nfsd.service deleted file mode 100644 index 111b56f9cfa..00000000000 --- a/extras/systemd/glusterd-nfsd.service +++ /dev/null @@ -1,16 +0,0 @@ -[Unit] -Description=GlusterFS NFS Daemon -After=network.target rpcbind.service -Before=network-online.target - -[Service] -Type=forking -EnvironmentFile=/var/lib/glusterd/glusterd.info -ExecStartPre=-/bin/pkill -f 'glusterfs.*gluster/nfs' -ExecStart=/usr/sbin/glusterfs -s localhost --volfile-id gluster/nfs -p /var/lib/glusterd/nfs/run/nfs.pid -l /var/log/glusterfs/nfs.log -S /var/lib/glusterd/nfs/run/${UUID}.socket -PIDFile=/var/lib/glusterd/nfs/run/nfs.pid -ExecStop=-/bin/pkill -f 'glusterfs.*gluster/nfs' -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/extras/systemd/glusterd-shd.service b/extras/systemd/glusterd-shd.service deleted file mode 100644 index 0b606f947cd..00000000000 --- a/extras/systemd/glusterd-shd.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=GlusterFS Self-Heal Daemon -After=network.target rpcbind.service -Before=network-online.target - -[Service] -Type=forking -EnvironmentFile=/var/lib/glusterd/glusterd.info -LimitNOFILE=65536 -ExecStartPre=-/bin/pkill -f '^/usr/sbin/glusterfs.*gluster/glustershd' -ExecStart= /usr/sbin/glusterfs -s localhost --volfile-id gluster/glustershd -p /var/lib/glusterd/glustershd/run/glustershd.pid -l /var/log/glusterfs/glustershd.log --xlator-option *replicate*.node-uuid=${UUID} -S /var/lib/glusterd/glustershd/run/${UUID}.socket -PIDFile=/var/lib/glusterd/glustershd/run/glustershd.pid -ExecStop=/bin/pkill -f '^/usr/sbin/glusterfs.*gluster/glustershd' -Restart=always - -[Install] -WantedBy=multi-user.target diff --git a/extras/systemd/glustereventsd.service b/extras/systemd/glustereventsd.service deleted file mode 100644 index 73307282013..00000000000 --- a/extras/systemd/glustereventsd.service +++ /dev/null @@ -1,14 +0,0 @@ -[Unit] -Description=Gluster Events Notifier -After=syslog.target network.target - -[Service] -Environment=PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH -Type=simple -ExecStart=/usr/local/sbin/glustereventsd --pid-file /var/run/glustereventsd.pid -ExecReload=/bin/kill -SIGUSR2 $MAINPID -KillMode=control-group -PIDFile=/var/run/glustereventsd.pid - -[Install] -WantedBy=multi-user.target diff --git a/extras/systemd/glusterfssharedstorage.service b/extras/systemd/glusterfssharedstorage.service deleted file mode 100644 index 95da3dfbabd..00000000000 --- a/extras/systemd/glusterfssharedstorage.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=Mount glusterfs sharedstorage -Requires=glusterd.service remote-fs-pre.target local-fs.target - -[Service] -Type=forking -ExecStart=/usr/local/libexec/glusterfs/mount-shared-storage.sh -Restart=on-failure -RestartSec=3 -RestartForceExitStatus=1 - -[Install] -WantedBy=multi-user.target diff --git a/glusterfs.spec.in b/glusterfs.spec.in index 4ae3b8fe7e3..837604ede4a 100644 --- a/glusterfs.spec.in +++ b/glusterfs.spec.in @@ -83,6 +83,8 @@ # Disable data-tiering on EL5, sqlite is too old %if ( 0%{?rhel} && 0%{?rhel} < 6 ) %global _without_tiering --disable-tiering +%else +%{?_without_tiering:%global _without_tiering --disable-tiering} %endif # if you wish to compile an rpm with Facebook specfic extras... @@ -93,7 +95,9 @@ ## All %%global definitions should be placed here and keep them sorted ## -%global _with_systemd true +%if ( 0%{rhel} && 0%{?rhel} >= 7 ) +%global _with_systemd --with-systemd +%endif %global _without_firewalld --disable-firewalld @@ -110,17 +114,16 @@ %endif %if ( 0%{?_with_systemd:1} ) +%global _init_glusterd %{_unitdir}/glusterd-mgmt.service +%global _init_glusterd_nfsd %{_unitdir}/glusterd-nfsd.service +%global _init_glusterd_gfproxyd %{_unitdir}/glusterd-gfproxyd.service +%global _init_glusterd_shd %{_unitdir}/glusterd-shd.service %global _init_enable() /bin/systemctl enable %1.service ; %global _init_disable() /bin/systemctl disable %1.service ; %global _init_restart() /bin/systemctl restart %1.service ; %global _init_start() /bin/systemctl start %1.service ; %global _init_stop() /bin/systemctl stop %1.service ; %global _init_install() install -D -p -m 0644 %1 %{buildroot}%{_unitdir}/%2.service ; -# can't seem to make a generic macro that works -%global _init_glusterd %{_unitdir}/glusterd-mgmt.service -%global _init_glusterd_nfsd %{_unitdir}/glusterd-nfsd.service -%global _init_glusterd_gfproxyd %{_unitdir}/glusterd-gfproxyd.service -%global _init_glusterd_shd %{_unitdir}/glusterd-shd.service %else %global _init_enable() /sbin/chkconfig --add %1 ; %global _init_disable() /sbin/chkconfig --del %1 ; @@ -128,9 +131,11 @@ %global _init_start() /sbin/service %1 start &>/dev/null ; %global _init_stop() /sbin/service %1 stop &>/dev/null ; %global _init_install() install -D -p -m 0755 %1 %{buildroot}%{_sysconfdir}/init.d/%2 ; -# can't seem to make a generic macro that works %global _init_glusterd %{_sysconfdir}/init.d/glusterd %global _init_glusterfsd %{_sysconfdir}/init.d/glusterfsd +%if ( 0%{?_with_fbextras:1} ) +%global _init_glusterd_functions %{_sysconfdir}/init.d/glusterd.functions +%endif %endif %if ( 0%{_for_fedora_koji_builds} ) @@ -214,11 +219,7 @@ BuildRequires: libxml2-devel openssl-devel BuildRequires: libaio-devel libacl-devel BuildRequires: python-devel BuildRequires: python-ctypes -%if ( 0%{?rhel} && 0%{?rhel} == 7 ) BuildRequires: libtirpc libtirpc-devel -%else -BuildRequires: libfbtirpc libfbtirpc-devel -%endif BuildRequires: jemalloc jemalloc-devel BuildRequires: gperftools-devel gperftools-libs BuildRequires: userspace-rcu-devel >= 0.7 @@ -544,11 +545,7 @@ Requires: %{name}-fuse%{?_isa} = %{version}-%{release} # self-heal daemon, rebalance, nfs-server etc. are actually clients Requires: %{name}-api%{?_isa} = %{version}-%{release} Requires: %{name}-client-xlators%{?_isa} = %{version}-%{release} -%if ( 0%{?rhel} && 0%{?rhel} == 7 ) Requires: libtirpc >= 0.2.4 -%else -Requires: libfbtirpc >= 0.2.5-1 -%endif Requires: jemalloc >= 3.6.0-1 # psmisc for killall, lvm2 for snapshot, and nfs-utils and # rpcbind/portmap for gnfs server @@ -611,11 +608,7 @@ This package provides the translators needed on any GlusterFS client. %package server-nodeps Summary: Clustered file-system server Group: System Environment/Daemons -%if ( 0%{?rhel} && 0%{?rhel} == 7 ) Requires: libtirpc >= 0.2.4 -%else -Requires: libfbtirpc >= 0.2.5-1 -%endif Requires: jemalloc >= 3.6.0-1 # psmisc for killall, lvm2 for snapshot, and nfs-utils and # rpcbind/portmap for gnfs server @@ -675,8 +668,6 @@ export CFLAGS %endif %configure \ - --with-jemalloc \ - --enable-mempool \ %{?_with_cmocka} \ %{?_with_debug} \ %{?_with_tmpfilesdir} \ @@ -691,7 +682,7 @@ export CFLAGS %{?_without_tiering} \ %{?_with_asan} \ %{?_with_fbextras} \ - %{?_with_systemd:--with-systemd} + %{?_with_systemd} # fix hardening and remove rpath in shlibs %if ( 0%{?fedora} && 0%{?fedora} > 17 ) || ( 0%{?rhel} && 0%{?rhel} > 6 ) @@ -869,8 +860,15 @@ if [ -d "$CONF_DIR" ]; then echo "Creating backup of $CONF_DIR @ $BACKUP_FILE..." tar czf "$BACKUP_FILE" -c $CONF_DIR 2> /dev/null fi +%if ( 0%{?_with_fbextras:1} ) +%_init_enable glusterd-mgmt +%_init_enable glusterd-shd +%_init_enable glusterd-shd +%_init_enable glusterd-gfproxyd +%else # Legacy server %_init_enable glusterd +%endif %if ( 0%{_for_fedora_koji_builds} ) %_init_enable glusterfsd %endif @@ -967,7 +965,15 @@ if [ -d "$CONF_DIR" ]; then tar czf "$BACKUP_FILE" -c $CONF_DIR 2> /dev/null fi # Legacy server +%if ( 0%{?_with_fbextras:1} ) +%_init_enable glusterd-mgmt +%_init_enable glusterd-shd +%_init_enable glusterd-shd +%_init_enable glusterd-gfproxyd +%else +# Legacy server %_init_enable glusterd +%endif %if ( 0%{_for_fedora_koji_builds} ) %_init_enable glusterfsd %endif @@ -1342,12 +1348,14 @@ exit 0 # init files %_init_glusterd -%if ( 0%{!?_with_systemd:1} ) -%_init_glusterd_functions -%else +%if ( 0%{?_with_systemd:1} ) %_init_glusterd_nfsd %_init_glusterd_shd %_init_glusterd_gfproxyd +%else +%if ( 0%{?_with_fbextras:1} ) +%_init_glusterd_functions +%endif %endif %if ( 0%{_for_fedora_koji_builds} ) %_init_glusterfsd @@ -1470,12 +1478,14 @@ exit 0 # init files %_init_glusterd -%if ( 0%{!?_with_systemd:1} ) -%_init_glusterd_functions -%else +%if ( 0%{?_with_systemd:1} ) %_init_glusterd_nfsd %_init_glusterd_shd %_init_glusterd_gfproxyd +%else +%if ( 0%{?_with_fbextras:1} ) +%_init_glusterd_functions +%endif %endif %if ( 0%{_for_fedora_koji_builds} ) %_init_glusterfsd diff --git a/xlators/features/changetimerecorder/src/Makefile.am b/xlators/features/changetimerecorder/src/Makefile.am index 503c6db5286..7b3dd9f19f8 100644 --- a/xlators/features/changetimerecorder/src/Makefile.am +++ b/xlators/features/changetimerecorder/src/Makefile.am @@ -1,7 +1,7 @@ xlatordir = $(libdir)/glusterfs/$(PACKAGE_VERSION)/xlator/features # changetimerecorder can only get build when libgfdb is enabled -if BUILD_GFDB +if USE_GFDB xlator_LTLIBRARIES = changetimerecorder.la endif |