Compare commits

..

5 commits

Author SHA1 Message Date
Gwyn Ciesla
ec2c972b5f Merge branch 'epel9' into epel8 2023-09-26 12:36:25 -05:00
Gwyn Ciesla
7c011da351 Require initscripts 2023-09-26 12:35:45 -05:00
Troy Dawson
7fba9bf1a5 remove package.cfg per new epel-playground policy 2020-09-24 18:33:14 +00:00
Gwyn Ciesla
7969a95ab7 Merge branch 'master' into epel8 2020-04-07 14:37:28 -04:00
Gwyn Ciesla
92084429e4 "Adding package.cfg file" 2020-04-07 13:36:59 -05:00
13 changed files with 629 additions and 1 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
ucarp-1.5.2.tar.bz2

View file

@ -1 +0,0 @@
Dead upstream, old website NSFW

1
sources Normal file
View file

@ -0,0 +1 @@
723636dbf79fc6abd329a71ec4ddf79d ucarp-1.5.2.tar.bz2

145
ucarp Executable file
View file

@ -0,0 +1,145 @@
#!/bin/bash
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
#[ ${NETWORKING} = "no" ] && exit 0
get_files() {
_cfg=$1
FILES=`find ${CONFDIR} -maxdepth 1 -type f -name "vip-${_cfg}.conf" \
-printf "%f\n" | egrep '^vip-[[:digit:]]+\.conf$' | LC_COLLATE="C" sort`
}
prog=$"common address redundancy protocol daemon"
LOGGER="/usr/bin/logger -p daemon.notice -t ucarp"
CONFDIR=/etc/ucarp
UPSCRIPT=/usr/libexec/ucarp/vip-up
DOWNSCRIPT=/usr/libexec/ucarp/vip-down
config=$2
start() {
RETVAL=-1
VIP_RETVAL=0
echo -n $"Starting ${prog}: "
get_files $config
if [ -z "${FILES}" ]; then
${LOGGER} "no virtual addresses are configured in ${CONFDIR}"
failure
RETVAL=1
else
for FILE in ${FILES}; do
# Check that the file name gives us an ID between 1 and 255
ID=`echo ${FILE}| sed 's/^vip-\(.*\).conf/\1/'`
if [ ${ID} -lt 1 -o ${ID} -gt 255 ]; then
${LOGGER} "ID out of range (1-255) for ${FILE}, skipped VIP ID ${ID}"
continue
fi
#unset PASSWORD BIND_INTERFACE SOURCE_ADDRESS VIP_ADDRESS OPTIONS
# Source ucarp settings
. ${CONFDIR}/vip-common.conf
. ${CONFDIR}/${FILE}
TMP_RETVAL=0
if [ -z "${PASSFILE}" ]; then
${LOGGER} "no PASSFILE found for ${FILE}, skipped VIP ID ${ID}"
TMP_RETVAL=1
fi
if [ -z "${BIND_INTERFACE}" ]; then
${LOGGER} "no BIND_INTERFACE found for ${FILE}, skipped VIP ID ${ID}"
TMP_RETVAL=1
fi
if [ -z "${SOURCE_ADDRESS}" ]; then
${LOGGER} "no SOURCE_ADDRESS found for ${FILE}, skipped VIP ID ${ID}"
TMP_RETVAL=1
fi
if [ -z "${VIP_ADDRESS}" ]; then
${LOGGER} "no VIP_ADDRESS found for ${FILE}, skipped VIP ID ${ID}"
TMP_RETVAL=1
fi
# If one of more of the above failed, skip the daemon launch
if [ ${TMP_RETVAL} -ne 0 ]; then
VIP_RETVAL=1
continue
fi
[ ${RETVAL} -eq -1 ] && RETVAL=0
daemon /usr/sbin/ucarp --daemonize --interface=${BIND_INTERFACE} --passfile=${PASSFILE} --srcip=${SOURCE_ADDRESS} --vhid=${ID} --addr=${VIP_ADDRESS} ${OPTIONS} --upscript=$UPSCRIPT --downscript=$DOWNSCRIPT >/dev/null
LAUNCH_RETVAL=$?
[ ${LAUNCH_RETVAL} -ne 0 ] && RETVAL=1
done
# failure/success or warning if launch worked with some vip errors
if [ ${RETVAL} -eq 0 -a ${VIP_RETVAL} -eq 0 ]; then
${LOGGER} "all ucarp configurations were applied successfully"
success
touch /var/lock/subsys/ucarp
elif [ ${RETVAL} -eq 0 -a ${VIP_RETVAL} -eq 1 ]; then
${LOGGER} "error in one or more of the ucarp configurations"
warning
else
${LOGGER} "error running one or more of the ucarp daemon instances"
failure
fi
fi
echo
}
stop() {
echo -n $"Stopping $prog: "
killproc /usr/sbin/ucarp >/dev/null
RETVAL=$?
# With "--shutdown" in the default OPTIONS, the down script is called
# when ucarp is stopped, so IP addresses are released, no "leftovers".
# failure/success (no warning, too complicated to handle properly)
if [ ${RETVAL} -eq 1 ]; then
${LOGGER} "it seems like no ucarp daemon were running"
failure
else
${LOGGER} "all ucarp daemons stopped and IP addresses unassigned"
success
rm -f /var/lock/subsys/ucarp
fi
echo
}
# See how we were called.
#case "$1" in
# start)
# start
# ;;
# stop)
# stop
# ;;
# restart)
# stop
# start
# ;;
# condrestart)
# if [ -f /var/lock/subsys/ucarp ]; then
# stop
# start
# fi
# ;;
# status)
# status /usr/sbin/ucarp
# ;;
# *)
# echo $"Usage: $0 {start|stop|restart|condrestart|status}"
# exit 1
#esac
start
exit $RETVAL

10
ucarp-1.5.2-sighup.patch Normal file
View file

@ -0,0 +1,10 @@
--- src/carp.c~ 2010-01-31 15:59:12.000000000 -0600
+++ src/carp.c 2012-10-25 09:25:54.949976635 -0500
@@ -762,6 +762,7 @@
if (shutdown_at_exit != 0) {
(void) signal(SIGINT, sighandler_exit);
+ (void) signal(SIGHUP, sighandler_exit);
(void) signal(SIGQUIT, sighandler_exit);
(void) signal(SIGTERM, sighandler_exit);
}

156
ucarp.init Executable file
View file

@ -0,0 +1,156 @@
#!/bin/bash
# $Id$
#
# chkconfig: - 91 09
# description: Starts and stops the common address redundancy protocol daemon
### BEGIN INIT INFO
# Provides: lsb-ucarp
# Required-Start: $local_fs $network $remote_fs
# Required-Stop: $local_fs $network $remote_fs
# Default-Start:
# Default-Stop: 0 1 6
# Short-Description: start and stop ucarp
# Description: Common Address Redundancy Protocol (CARP) for Unix
### END INIT INFO
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
get_files() {
FILES=`find ${CONFDIR} -maxdepth 1 -type f -name 'vip-*.conf' \
-printf "%f\n" | egrep '^vip-[[:digit:]]+\.conf$' | LC_COLLATE="C" sort`
}
prog=$"common address redundancy protocol daemon"
LOGGER="/usr/bin/logger -p daemon.notice -t ucarp"
CONFDIR=/etc/ucarp
UPSCRIPT=/usr/libexec/ucarp/vip-up
DOWNSCRIPT=/usr/libexec/ucarp/vip-down
start() {
RETVAL=-1
VIP_RETVAL=0
echo -n $"Starting ${prog}: "
get_files
if [ -z "${FILES}" ]; then
${LOGGER} "no virtual addresses are configured in ${CONFDIR}"
failure
RETVAL=1
else
for FILE in ${FILES}; do
# Check that the file name gives us an ID between 1 and 255
ID=`echo ${FILE}| sed 's/^vip-\(.*\).conf/\1/'`
if [ ${ID} -lt 1 -o ${ID} -gt 255 ]; then
${LOGGER} "ID out of range (1-255) for ${FILE}, skipped VIP ID ${ID}"
continue
fi
unset PASSWORD BIND_INTERFACE SOURCE_ADDRESS VIP_ADDRESS OPTIONS
# Source ucarp settings
. ${CONFDIR}/vip-common.conf
. ${CONFDIR}/${FILE}
TMP_RETVAL=0
if [ -z "${PASSWORD}" ]; then
${LOGGER} "no PASSWORD found for ${FILE}, skipped VIP ID ${ID}"
TMP_RETVAL=1
fi
if [ -z "${BIND_INTERFACE}" ]; then
${LOGGER} "no BIND_INTERFACE found for ${FILE}, skipped VIP ID ${ID}"
TMP_RETVAL=1
fi
if [ -z "${SOURCE_ADDRESS}" ]; then
${LOGGER} "no SOURCE_ADDRESS found for ${FILE}, skipped VIP ID ${ID}"
TMP_RETVAL=1
fi
if [ -z "${VIP_ADDRESS}" ]; then
${LOGGER} "no VIP_ADDRESS found for ${FILE}, skipped VIP ID ${ID}"
TMP_RETVAL=1
fi
# If one of more of the above failed, skip the daemon launch
if [ ${TMP_RETVAL} -ne 0 ]; then
VIP_RETVAL=1
continue
fi
[ ${RETVAL} -eq -1 ] && RETVAL=0
daemon /usr/sbin/ucarp --daemonize --interface=${BIND_INTERFACE} --pass=${PASSWORD} --srcip=${SOURCE_ADDRESS} --vhid=${ID} --addr=${VIP_ADDRESS} ${OPTIONS} --upscript=$UPSCRIPT --downscript=$DOWNSCRIPT >/dev/null
LAUNCH_RETVAL=$?
[ ${LAUNCH_RETVAL} -ne 0 ] && RETVAL=1
done
# failure/success or warning if launch worked with some vip errors
if [ ${RETVAL} -eq 0 -a ${VIP_RETVAL} -eq 0 ]; then
${LOGGER} "all ucarp configurations were applied successfully"
success
touch /var/lock/subsys/ucarp
elif [ ${RETVAL} -eq 0 -a ${VIP_RETVAL} -eq 1 ]; then
${LOGGER} "error in one or more of the ucarp configurations"
warning
else
${LOGGER} "error running one or more of the ucarp daemon instances"
failure
fi
fi
echo
}
stop() {
echo -n $"Stopping $prog: "
killproc /usr/sbin/ucarp >/dev/null
RETVAL=$?
# With "--shutdown" in the default OPTIONS, the down script is called
# when ucarp is stopped, so IP addresses are released, no "leftovers".
# failure/success (no warning, too complicated to handle properly)
if [ ${RETVAL} -eq 1 ]; then
${LOGGER} "it seems like no ucarp daemon were running"
failure
else
${LOGGER} "all ucarp daemons stopped and IP addresses unassigned"
success
rm -f /var/lock/subsys/ucarp
fi
echo
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
condrestart)
if [ -f /var/lock/subsys/ucarp ]; then
stop
start
fi
;;
status)
status /usr/sbin/ucarp
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac
exit $RETVAL

276
ucarp.spec Normal file
View file

@ -0,0 +1,276 @@
%define _hardened_build 1
Summary: Common Address Redundancy Protocol (CARP) for Unix
Name: ucarp
Version: 1.5.2
Release: 33%{?dist}
# See the COPYING file which details everything
License: MIT and BSD
URL: http://www.ucarp.org/
Source0: http://download.pureftpd.org/pub/ucarp/ucarp-%{version}.tar.bz2
Source1: ucarp@.service
Source2: vip-001.conf.example
Source3: vip-common.conf
Source4: vip-up
Source5: vip-down
#Source6: vip-helper.sh
Source7: ucarp
Source8: vip-001.pwd.example
Patch0: ucarp-1.5.2-sighup.patch
BuildRequires: make
BuildRequires: gettext
BuildRequires: autoconf, automake, libtool
BuildRequires: libpcap-devel
BuildRequires: systemd
Requires: initscripts
%description
UCARP allows a couple of hosts to share common virtual IP addresses in order
to provide automatic failover. It is a portable userland implementation of the
secure and patent-free Common Address Redundancy Protocol (CARP, OpenBSD's
alternative to the patents-bloated VRRP).
Strong points of the CARP protocol are: very low overhead, cryptographically
signed messages, interoperability between different operating systems and no
need for any dedicated extra network link between redundant hosts.
%prep
%setup -q
%patch0 -p0
%build
export CPPFLAGS="$CPPFLAGS -fcommon"
%configure
%{__make} %{?_smp_mflags}
%install
%{__make} install DESTDIR=%{buildroot}
%find_lang %{name}
# Install the unit file
%{__install} -D -p -m 0755 %{SOURCE1} \
%{buildroot}%{_unitdir}/ucarp@.service
%{__mkdir_p} %{buildroot}/etc/ucarp
%{__mkdir_p} %{buildroot}%{_libexecdir}/ucarp
# Install the example config files
%{__install} -D -p -m 0600 %{SOURCE2} %{SOURCE3} %{SOURCE8} \
%{buildroot}/etc/ucarp/
# Install helper scripts
%{__install} -D -p -m 0700 %{SOURCE4} %{SOURCE5} %{SOURCE7} \
%{buildroot}%{_libexecdir}/ucarp/
%pre
# Legacy, in case we update from an older package where the service was "carp"
if [ -f /etc/rc.d/init.d/carp ]; then
/sbin/service carp stop &>/dev/null || :
/sbin/chkconfig --del carp
fi
%post
%systemd_post ucarp@.service
%preun
%systemd_preun ucarp@.service
%postun
%systemd_postun_with_restart ucarp@.service
%files -f %{name}.lang
%license COPYING
%doc AUTHORS ChangeLog NEWS README
%{_unitdir}/ucarp@.service
%attr(0700,root,root) %dir /etc/ucarp/
%config(noreplace) /etc/ucarp/vip-common.conf
/etc/ucarp/vip-001.conf.example
/etc/ucarp/vip-001.pwd.example
%config(noreplace) %{_libexecdir}/ucarp/
%{_sbindir}/ucarp
%changelog
* Tue Sep 26 2023 Gwyn Ciesla <gwync@protonmail.com> - 1.5.2-33
- Require initscripts
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-32
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-31
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Tue Mar 02 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.5.2-30
- Rebuilt for updated systemd-rpm-macros
See https://pagure.io/fesco/issue/2583.
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-29
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-28
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Mon Feb 10 2020 Gwyn Ciesla <gwync@protonmail.com> - 1.5.2-27
- Fix FTBFS.
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-26
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-25
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-23
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Feb 26 2018 Gwyn Ciesla <limburgher@gmail.com> - 1.5.2-22
- Incorporate systemd tweaks from Hans-Werner Jouy.
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Tue Aug 08 2017 Gwyn Ciesla <limburgher@gmail.com> - 1.5.2-20
- Correct unit file target.
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Tue Mar 14 2017 Jon Ciesla <limburgher@gmail.com> - 1.5.2-17
- systemd cleanup
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.5.2-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Thu Aug 21 2014 Kevin Fenzi <kevin@scrye.com> - 1.5.2-13
- Rebuild for rpm bug 1131960
* Mon Aug 18 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-12
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Mon Aug 05 2013 Jon Ciesla <limburgher@gmail.com> - 1.5.2-10
- Fix FTBFS, BZ 992829.
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
* Thu Oct 25 2012 Jon Ciesla <limburgher@gmail.com> - 1.5.2-7
- Patch to fix crash, BZ 693762.
* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Fri Apr 13 2012 Jon Ciesla <limburgher@gmail.com> - 1.5.2-5
- Add hardened build.
* Wed Mar 14 2012 Jon Ciesla <limburgher@gmail.com> - 1.5.2-4
- Migrate to systemd, BZ 800498.
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Wed Apr 28 2010 Jon Ciesla <limb@jcomserv.net> - 1.5.2-1
- New upstream.
- Uses arc4random() if available.
- Avoids adverts that might be twice as what they should be.
- Marked vip-up and vip-down config(noreplace), BZ 586893.
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Wed Jul 08 2009 Jon Ciesla <limb@jcomserv.net> - 1.5.1-1
- New upstream.
- New option (--nomcast / -M) to use broadcast
- advertisements instead of multicast ones.
* Mon Apr 13 2009 Jon Ciesla <limb@jcomserv.net> - 1.5-1
- Update to 1.5 BZ 458767.
- Added LSB header to init script, BZ 247082.
- New upstream should address BZ 427495, 449266, 455394.
* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Sun Feb 3 2008 Matthias Saou <http://freshrpms.net/> 1.4-1
- Update to 1.4.
- Rip out all of the "list" stuff and 255.255.255.255 address hack (#427495).
- Change from INITLOG (now deprecated) to LOGGER in the init script.
- Move helper scripts to /usr/libexec/ucarp/.
* Thu Aug 23 2007 Matthias Saou <http://freshrpms.net/> 1.2-9
- Rebuild for new BuildID feature.
* Sun Aug 5 2007 Matthias Saou <http://freshrpms.net/> 1.2-8
- Update License field.
* Fri Feb 2 2007 Matthias Saou <http://freshrpms.net/> 1.2-7
- Rename service from carp to ucarp, to be more consistent.
- Move /etc/sysconfig/carp to /etc/ucarp since it has become a config directory
of its own.
* Wed Nov 29 2006 Matthias Saou <http://freshrpms.net/> 1.2-6
- Rebuild against new libpcap.
* Mon Nov 13 2006 Matthias Saou <http://freshrpms.net/> 1.2-5
- Include all improvements from Denis Ovsienko (#200395).
* Mon Aug 28 2006 Matthias Saou <http://freshrpms.net/> 1.2-4
- FC6 rebuild.
* Tue Aug 22 2006 Matthias Saou <http://freshrpms.net/> 1.2-3
- Update to 1.3 snapshot, which includes the ARP fix, as well as fixes for the
segfaults reported in #200400 and #201596.
- Add autoconf, automake and libtool build reqs for the 1.3 patch.
* Thu Jul 27 2006 Matthias Saou <http://freshrpms.net/> 1.2-3
- Fix init script for recent find versions (#200395).
* Thu Jun 22 2006 Matthias Saou <http://freshrpms.net/> 1.2-2
- Include ARP patch backported from 1.3 snapshot (#196095).
- Make libpcap build requirement conditional to be able to share spec file.
* Wed Jun 21 2006 Matthias Saou <http://freshrpms.net/> 1.2-1
- Update to 1.2.
- BuildRequire libpcap-devel instead of libpcap now that it has been split.
* Mon Mar 6 2006 Matthias Saou <http://freshrpms.net/> 1.1-5
- FC5 rebuild.
* Thu Feb 9 2006 Matthias Saou <http://freshrpms.net/> 1.1-4
- Rebuild for new gcc/glibc.
* Thu Nov 17 2005 Matthias Saou <http://freshrpms.net/> 1.1-3
- Rebuild against new libpcap library.
* Fri Apr 1 2005 Michael Schwendt <mschwendt[AT]users.sf.net> - 1.1-2
- Add %%dir entry for /etc/sysconfig/carp directory.
* Thu Jan 13 2005 Matthias Saou <http://freshrpms.net/> 1.1-1
- Update to 1.1.
- Update source location.
* Fri Jul 9 2004 Matthias Saou <http://freshrpms.net/> 1.0-1
- Initial RPM release.

11
ucarp@.service Normal file
View file

@ -0,0 +1,11 @@
[Unit]
Description=Common address redundancy protocol daemon, config: vip-%I.conf
After=syslog.target network-online.target
[Service]
PrivateTmp=true
Type=forking
ExecStart=/usr/libexec/ucarp/ucarp start %i
[Install]
WantedBy=multi-user.target

10
vip-001.conf.example Normal file
View file

@ -0,0 +1,10 @@
# Virtual IP configuration file for UCARP
# The number (from 001 to 255) in the name of the file is the identifier
# In the simple scenario, you want a single virtual IP address from the _same_
# network to be taken over by one of the routers.
VIP_ADDRESS="10.0.0.254"
# In more complex scenarios, check the "vip-common" file for values to override
# and how to add options.

1
vip-001.pwd.example Normal file
View file

@ -0,0 +1 @@
love

8
vip-common.conf Normal file
View file

@ -0,0 +1,8 @@
# Common VIP settings which can be overridden in individual vip-<nnnn>.conf
PASSFILE=/etc/ucarp/vip-001.pwd
BIND_INTERFACE="eth0"
SOURCE_ADDRESS=""
# If you have extra options to add, see "ucarp --help" output
OPTIONS="--shutdown --preempt"

5
vip-down Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
exec 2>/dev/null
/sbin/ip address del "$2"/32 dev "$1"

5
vip-up Executable file
View file

@ -0,0 +1,5 @@
#!/bin/sh
exec 2>/dev/null
/sbin/ip address add "$2"/32 dev "$1"