From 9710faa87eca9a7f0c8178247a7a4b562fd465b4 Mon Sep 17 00:00:00 2001 From: Automatic Build System Date: Fri, 5 Jan 2024 23:58:07 +0100 Subject: [PATCH] update to 1.27 [release 1.27-1mamba;Sat Sep 14 2013] --- README.md | 3 ++ ipvsadm-initscript | 106 +++++++++++++++++++++++++++++++++++++++++++++ ipvsadm-sysconfig | 9 ++++ ipvsadm.spec | 88 +++++++++++++++++++++++++++++++++++++ 4 files changed, 206 insertions(+) create mode 100644 ipvsadm-initscript create mode 100644 ipvsadm-sysconfig create mode 100644 ipvsadm.spec diff --git a/README.md b/README.md index bc68f39..e8ccd07 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,5 @@ # ipvsadm +IPVS (IP Virtual Server) implements transport-layer load balancing inside the Linux kernel, so called Layer-4 switching. IPVS running on a host acts as a load balancer before a cluster of real servers, it can direct requests for TCP/UDP based services to the real servers, and makes services of the real servers to appear as a virtual service on a single IP address. +This package contains the user space tools for IPVS. + diff --git a/ipvsadm-initscript b/ipvsadm-initscript new file mode 100644 index 0000000..081da33 --- /dev/null +++ b/ipvsadm-initscript @@ -0,0 +1,106 @@ +#!/bin/sh +# +# Startup script handle the initialisation of LVS +# +# chkconfig: 2345 08 92 +# +# description: Initialise the Linux Virtual Server +# http://www.linuxvirtualserver.org/ +# +# Script Author: Horms +# +# Based on init script for ipchains by Joshua Jensen +# +# Changes: +# Wenzhuo Zhang : fixed the typo of failure function +# +# 04-28-2004: modified by Silvan Calarco for the QiLinux distrubition +# +# config: /etc/sysconfig/ipvsadm +# config: /etc/ipvsadm.rules + + +# set the configuration file +if [ -f "/etc/sysconfig/ipvsadm" ]; then + IPVSADM_CONFIG="/etc/sysconfig/ipvsadm" +elif [ -f "/etc/ipvsadm.rules" ]; then + IPVSADM_CONFIG="/etc/ipvsadm.rules" +else + IPVSADM_CONFIG="/etc/sysconfig/ipvsadm" +fi + +# Use the funtions provided by Red Hat or use our own +if [ -f /etc/rc.d/init.d/functions ] +then + . /etc/rc.d/init.d/functions +else + function action { + echo "$1" + shift + $@ + } + function success { + echo -n "Success" + } + function failure { + echo -n "Failed" + } +fi + +# Check for ipvsadm in both /sbin and /usr/sbin +# The default install puts it in /sbin, as it is analogos to commands such +# as route and ipchains that live in /sbin. Some vendors, most notibly +# Red Hat insist on moving it to /usr/sbin +if [ ! -x /sbin/ipvsadm -a ! -x /usr/sbin/ipvsadm ]; then + exit 0 +fi + +case "$1" in + start) + # If we don't clear these first, we might be adding to + # pre-existing rules. + action "Clearing the current IPVS table:" ipvsadm -C + echo -n "Applying IPVS configuration: " + ipvsadm-restore < "$IPVSADM_CONFIG" && \ + success "Applying IPVS configuration" || \ + failure "Applying IPVS configuration" + echo + touch /var/lock/subsys/ipvsadm + ;; + + stop) + action "Clearing the current IPVS table:" ipvsadm -C + rm -f /var/lock/subsys/ipvsadm + ;; + + reload|reload-force|restart) + #Start should flush everything + $0 start + ;; + + panic) + # I'm not sure what panic does but in the case of IPVS + # it makes sense just to clear everything + action "Clearing the current IPVS table:" ipvsadm -C + ;; + + status) + ipvsadm -L -n + ;; + + save) + echo -n "Saving IPVS table to $IPVSADM_CONFIG: " + ipvsadm-save -n > $IPVSADM_CONFIG 2>/dev/null && \ + success "Saving IPVS table to $IPVSADM_CONFIG" || \ + failure "Saving IPVS table to $IPVSADM_CONFIG" + echo + ;; + + *) + echo "Usage: ipvsadm + {start|stop|restart|status|panic|save|reload|reload-force}" + exit 1 +esac + +exit 0 + diff --git a/ipvsadm-sysconfig b/ipvsadm-sysconfig new file mode 100644 index 0000000..5afe299 --- /dev/null +++ b/ipvsadm-sysconfig @@ -0,0 +1,9 @@ +# +# ipvsadm configuration file +# + +#ipvsadm -C +#ipvsadm -A -t 172.16.1.1:80 -s wrr +#ipvsadm -a -t 172.16.1.1:80 -r 192.168.6.235:80 -m -w 1 +#ipvsadm -a -t 172.16.1.1:80 -r 192.168.1.161:80 -m -w 1 +#ipvsadm -a -t 172.16.1.1:80 -r 192.168.1.167:80 -m -w 1 diff --git a/ipvsadm.spec b/ipvsadm.spec new file mode 100644 index 0000000..5fe8e45 --- /dev/null +++ b/ipvsadm.spec @@ -0,0 +1,88 @@ +Name: ipvsadm +Version: 1.27 +Release: 1mamba +Summary: User space tools for IPVS (IP Virtual Server) +Group: Applications/Networking +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: http://www.linuxvirtualserver.org +Source: https://www.kernel.org/pub/linux/utils/kernel/ipvsadm/ipvsadm-%{version}.tar.xz +Source1: ipvsadm-initscript +Source2: ipvsadm-sysconfig +License: GPL +BuildRequires: kernelsource +BuildRoot: %{_tmppath}/%{name}-%{version}-root + +%description +IPVS (IP Virtual Server) implements transport-layer load balancing inside the Linux kernel, so called Layer-4 switching. IPVS running on a host acts as a load balancer before a cluster of real servers, it can direct requests for TCP/UDP based services to the real servers, and makes services of the real servers to appear as a virtual service on a single IP address. +This package contains the user space tools for IPVS. + +%prep +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%setup -q + +%build +make MANDIR=%{_mandir} INCLUDE="-I/usr/src/linux-`uname -r`/include -I.. -I." + +%install +make install BUILD_ROOT=%{buildroot} MANDIR=%{_mandir} + +mkdir -p %{buildroot}%{_initrddir} +install -m 0755 %{SOURCE1} %{buildroot}%{_initrddir}/ipvsadm + +mkdir -p %{buildroot}%{_sysconfdir}/sysconfig +install -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/sysconfig/ipvsadm + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files +%defattr(-,root,root) +/sbin/* +%{_mandir}/man8/* +%{_initrddir}/ipvsadm +%config(noreplace) %{_sysconfdir}/sysconfig/ipvsadm + +%preun +if [ $1 -eq 0 ]; then +#erase + chkconfig ipvsadm + if test $? -eq 0; then + %{_initrddir}/ipvsadm stop + chkconfig --del ipvsadm + fi +fi + +%postun +if [ $1 -eq 1 ]; then +#update + chkconfig ipvsadm + test $? -eq 0 && %{_initrddir}/ipvsadm restart +fi + +%changelog +* Sat Sep 14 2013 Automatic Build System 1.27-1mamba +- update to 1.27 + +* Mon Feb 14 2011 Automatic Build System 1.26-1mamba +- automatic update by autodist + +* Fri Feb 05 2010 Silvan Calarco 1.25-2mamba +- rebuilt to remove executable requirements + +* Mon Jan 05 2009 Silvan Calarco 1.25-1mamba +- automatic update by autodist + +* Mon Jul 16 2007 Silvan Calarco 1.24-1mamba +- update to 1.24 + +* Wed Apr 28 2004 Silvan Calarco 1.21-2qilnx +- fixed initscript for chkconfig + +* Wed Apr 28 2004 Silvan Calarco 1.21-2qilnx +- added initscript + +* Tue Apr 27 2004 Silvan Calarco 1.21-1qilnx +- first build