SHA256
1
0
forked from pool/keepalived
keepalived/keepalived.spec

237 lines
6.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package keepalived
#
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
#Compat macro for new _fillupdir macro introduced in Nov 2017
%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif
%if 0%{?suse_version} > 1500
%bcond_without dbus
%bcond_without keepalived_nftables
%else
%bcond_with dbus
%bcond_with keepalived_nftables
%endif
%if 0%{?suse_version} >= 1500
%bcond_without keepalived_regex
%else
%bcond_with keepalived_regex
%endif
%bcond_without json
%bcond_without systemd
Name: keepalived
Version: 2.2.7
Release: 0
Summary: A keepalive facility for Linux
License: GPL-2.0-or-later
Group: Productivity/Networking/Routing
URL: https://www.keepalived.org/
Source: https://www.keepalived.org/software/%{name}-%{version}.tar.gz
Source2: keepalive-rpmlintrc
Patch0: keepalive-init.patch
Patch1: harden_keepalived.service.patch
BuildRequires: file-devel
BuildRequires: net-snmp-devel
BuildRequires: pkgconfig
BuildRequires: snmp-mibs
BuildRequires: pkgconfig(dbus-1)
BuildRequires: pkgconfig(gio-2.0)
BuildRequires: pkgconfig(openssl)
%if %{with json}
BuildRequires: pkgconfig(json-c)
%endif
BuildRequires: pkgconfig(libipset)
BuildRequires: pkgconfig(libiptc)
BuildRequires: pkgconfig(libnl-3.0)
%if %{with keepalived_regex}
BuildRequires: pkgconfig(libpcre2-8)
%endif
BuildRequires: pkgconfig(libnfnetlink)
%if %{with keepalived_nftables}
BuildRequires: pkgconfig(libnftables)
BuildRequires: pkgconfig(libnftnl)
%endif
BuildRequires: pkgconfig(popt)
BuildRequires: pkgconfig(xtables)
Requires(pre): pwdutils
Requires(pre): %fillup_prereq
%if %{with systemd}
BuildRequires: systemd-rpm-macros
BuildRequires: pkgconfig(libsystemd)
%{?systemd_ordering}
%else
Requires(pre): %insserv_prereq
%endif
%description
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 15:17:04 +00:00
This project provides facilities for load balancing and high-availability to
Linux system and Linux-based infrastructures. The load-balancing framework
relies on the Linux Virtual Server (IPVS) kernel module providing Layer4 load
balancing. Keepalived implements a set of checkers to dynamically and
adaptively maintain and manage loadbalanced server pool according their health.
High-availability is achieved by the VRRP protocol, a fundamental brick for
router failover. In addition, Keepalived implements a set of hooks to the VRRP
finite state machine, providing low-level and high-speed protocol interactions.
Keepalived frameworks can be used independently or all together to provide
resilient infrastructures.
%prep
%setup -q
%patch0 -p1
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 15:17:04 +00:00
chmod 644 doc/samples/*
%patch1 -p1
%build
export STRIP=true
export CPPFLAGS="$(pkg-config --cflags libnfnetlink libiptc libipset xtables)"
export CFLAGS="%optflags -DOPENSSL_NO_SSL_INTERN"
# --enable-dbus-create-instance \
%configure \
--disable-silent-rules \
--docdir=%{_defaultdocdir}/%{name}/ \
--enable-bfd \
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 15:17:04 +00:00
%if %{with json}
--enable-json \
%endif
--enable-snmp \
--enable-snmp-rfc \
%if %{with dbus}
--enable-dbus \
%endif
%if %{with keepalived_regex}
--enable-regex \
%endif
%if %{with keepalived_nftables}
--enable-nftables \
--disable-iptables \
%else
--enable-iptables \
--enable-libipset \
%endif
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 15:17:04 +00:00
%if %{with systemd}
--enable-systemd \
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 15:17:04 +00:00
--with-init=systemd \
--with-systemdsystemunitdir="%{_unitdir}" \
%else
--with-init=SUSE \
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 15:17:04 +00:00
%endif
--enable-sha1 \
--enable-gnu-std-paths \
--enable-hardening \
--enable-log-file \
--enable-routes \
--disable-dynamic-linking \
--disable-libiptc-dynamic \
--disable-libipset-dynamic \
--disable-libnl-dynamic \
--enable-libnl \
--enable-json
make %{?_smp_mflags}
%install
%make_install
install -dD -m 0750 %{buildroot}%{_var}/lib/%{name}
install -D -m 0644 %{buildroot}/etc/sysconfig/keepalived %{buildroot}%{_fillupdir}/sysconfig.%{name}
%if %{with systemd}
ln -s /sbin/service %{buildroot}%{_sbindir}/rckeepalived
%else
install -D -m 0750 keepalived/etc/init.d/keepalived.suse.init %{buildroot}/etc/init.d/keepalived
ln -s /etc/init.d/keepalived %{buildroot}%{_sbindir}/rckeepalived
%endif
chmod -R o= %{buildroot}/etc/keepalived
rm -rv %{buildroot}/etc/keepalived/samples/ %{buildroot}/etc/sysconfig/keepalived
cp -rv \
AUTHOR ChangeLog CONTRIBUTORS README doc/samples/ doc/keepalived.conf.SYNOPSIS doc/NOTE_vrrp_vmac.txt \
%{buildroot}%{_defaultdocdir}/%{name}/
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 15:17:04 +00:00
%check
# A build could silently have LVS support disabled if the kernel includes can't
# be properly found, we need to avoid that.
if ! grep -q "#define _WITH_LVS_ *1" lib/config.h; then
%{__echo} "ERROR: We do not want keepalived lacking LVS support." >&2
exit 1
fi
%pre
getent group %{name} >/dev/null || /usr/sbin/groupadd -r %{name}
getent passwd %{name} >/dev/null || \
/usr/sbin/useradd -g %{name} -s /bin/false -r -c "Keepalived" \
-d %{_var}/lib/%{name} %{name}
%if %{with systemd}
%service_add_pre %{name}.service
%endif
%preun
%if %{with systemd}
%service_del_preun %{name}.service
%else
%stop_on_removal %{name}
%endif
%post
%fillup_only %{name}
%if %{with systemd}
%service_add_post %{name}.service
%endif
%postun
%if %{with systemd}
%service_del_postun %{name}.service
%else
%insserv_cleanup
%restart_on_update %{name}
%endif
%files
%defattr(-,root,root)
%license COPYING
%doc %{_defaultdocdir}/%{name}/
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 15:17:04 +00:00
%dir %{_sysconfdir}/keepalived
%dir %attr(-,keepalived,keepalived) %{_var}/lib/%{name}
%config(noreplace) %ghost %attr(0640,root,root) %{_sysconfdir}/keepalived/keepalived.conf
%config %attr(0640,root,root) %{_sysconfdir}/keepalived/keepalived.conf.sample
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 15:17:04 +00:00
%{_fillupdir}/sysconfig.%{name}
%{_bindir}/genhash
%{_sbindir}/rckeepalived
%{_sbindir}/keepalived
Accepting request 563827 from home:lrupp:branches:network - update to 1.4.0 * Add Linux build and runtime versions to -v output. * Log kernel version and build kernel version to log at startup. * Don't sleep for 1 send when exiting vrrp process if no vrrp instances. * With large configurations the syslog can get flooded and drop output. This commit adds options to not log to syslog, and also to log all output to files. * Add option to only flush log files before forking. * Don't poll netlink for all interfaces each time add a VMAC. We can poll for the individual interface details which significantly reduces what we have to process. * Print interface details in keepalived.data output. * Add high performace child finder code. The code to find the relevant thread to execute afer a child process (either a vrrp track script or a misc_check healthchecker) was doing a linear search for the matching pid, which if there are a large number of child processes running could become time consuming. The code now will enable high performance child finding, based on using mlists hashed by the pid, if there are 32 or more vrrp track scripts or misc check healthcheckers. The size of the mlist is based on the number of scripts, with a limit of 256. * Improve high performance child termination timeout code. * Preserve filename in script path name resolution. Some executables change their behaviour depending on the name by which they are invoked (e.g. /usr/sbin/pidof when it is a link to /usr/sbin/killall5). Using realpath() changes the file name part if it is a symbolic link. This commit resolves all symbolic links to directories, but leaves the file name part unaltered. It then checks the security of both the path to the link and the path to the real file. OBS-URL: https://build.opensuse.org/request/show/563827 OBS-URL: https://build.opensuse.org/package/show/network/keepalived?expand=0&rev=38
2018-01-15 15:17:04 +00:00
%{_mandir}/man1/genhash.1*
%{_mandir}/man5/keepalived.conf.5*
%{_mandir}/man8/keepalived.8*
%{_datadir}/snmp/mibs/KEEPALIVED-MIB.txt
%{_datadir}/snmp/mibs/VRRP-MIB.txt
%{_datadir}/snmp/mibs/VRRPv3-MIB.txt
#
%if %{with dbus}
%config /etc/dbus-1/system.d/org.keepalived.Vrrp1.conf
%{_datadir}/dbus-1/interfaces/org.keepalived.Vrrp1.Instance.xml
%{_datadir}/dbus-1/interfaces/org.keepalived.Vrrp1.Vrrp.xml
%endif
#
%if %{with systemd}
%{_unitdir}/%name.service
%else
/etc/init.d/keepalived
%endif
%changelog