Compare commits

...
Sign in to create a new pull request.

12 commits

Author SHA1 Message Date
Jon Ciesla
9e8215d18b Init fix. 2016-03-05 12:23:19 -05:00
Jon Ciesla
bd68be23ff init fix. 2013-02-13 09:03:23 -06:00
Jon Ciesla
da59abbadd Drop MASTER from init. 2013-01-23 13:02:44 -06:00
Jon Ciesla
9ddc1b70e9 init fix for octal. 2012-12-11 09:04:43 -06:00
Jon Ciesla
0c5ad79177 Patch fix. 2012-11-13 11:46:43 -06:00
Jon Ciesla
20ecf82b26 Init fixes. 2012-11-12 14:44:59 -06:00
Jon Ciesla
278f2feb65 Merge branch 'f17' into el6
Conflicts:
	.gitignore
	ucarp.spec
2012-10-25 09:36:08 -05:00
Jon Ciesla
3080009b6d Fix for crash. 2012-10-25 09:34:21 -05:00
Fedora Release Engineering
033985bacb dist-git conversion 2010-07-29 14:36:25 +00:00
cf255c1aae Version bump. 2010-07-08 13:45:21 +00:00
Dennis Gilmore
52ea21ce7f Initialize branch EL-6 for ucarp 2010-05-08 02:26:31 +00:00
Bill Nottingham
973533e4ec Fix typo that causes a failure to update the common directory. (releng
#2781)
2009-11-26 01:13:15 +00:00
4 changed files with 78 additions and 12 deletions

2
.gitignore vendored
View file

@ -1 +1 @@
ucarp-1.5.2.tar.bz2
ucarp-1.5.1.tar.bz2

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);
}

View file

@ -21,11 +21,14 @@
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ "${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`
local FILE
cd ${CONFDIR}
for FILE in *.conf
do [ "${FILE}" != "vip-common.conf" ] && echo -n "${FILE} "
done
}
prog=$"common address redundancy protocol daemon"
@ -40,7 +43,7 @@ start() {
echo -n $"Starting ${prog}: "
get_files
FILES=`get_files`
if [ -z "${FILES}" ]; then
${LOGGER} "no virtual addresses are configured in ${CONFDIR}"
@ -48,17 +51,43 @@ start() {
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/'`
unset ID PASSWORD BIND_INTERFACE SOURCE_ADDRESS VIP_ADDRESS OPTIONS
. ${CONFDIR}/vip-common.conf
. ${CONFDIR}/${FILE}
# If the SOURCE_ADDRESS is not defined in the config, guess it from the ifcfg file
[ ${SOURCE_ADDRESS} ] || SOURCE_ADDRESS=$( . /etc/sysconfig/network-scripts/ifcfg-${BIND_INTERFACE} ; echo $IPADDR )
# If a value for MASTER is set in the file, use it to set advskew value
# The default advskew is 0, so if we are not the master, add advskew=1 to the options
# If the skew is already set in the options, then ignore the MASTER parameter
if ! [[ "${OPTIONS}" =~ "-k" || "${OPTIONS}" =~ "-advskew" ]]; then
[ "${MASTER:-NULL}" == "${SOURCE_ADDRESS}" ] || OPTIONS="${OPTIONS} --advskew=1"
fi
# Set the ID from the config file if it's defined, otherwise guess from the filename
if [[ -z "$ID" ]]; then
ID="${FILE#vip-}"; ID="${ID%.conf}"
IDnozero="${ID#0}"; IDnozero="${IDnozero#0}"
if [[ "$ID" != "$IDnozero" ]]; then
if [[ "${ID}" != "${ID/8}" || "${ID}" != "${ID/9}" ]]; then
# Has leading zeroes, is not a valid octal number.
# Remove leading zeroes, interpret it as decimal.
ID="$IDnozero"
else
# Has leading zeroes, will be interpreted as octal.
${LOGGER} "$FILE uses VIP ID" $(($ID)) "(octal $ID). To use $ID, add the line 'ID=$IDnozero' to $FILE or rename it to vip-$IDnozero.conf"
fi
fi
fi
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

View file

@ -1,7 +1,7 @@
Summary: Common Address Redundancy Protocol (CARP) for Unix
Name: ucarp
Version: 1.5.2
Release: 3%{?dist}
Release: 9%{?dist}
# See the COPYING file which details everything
License: MIT and BSD
Group: System Environment/Daemons
@ -13,6 +13,7 @@ Source3: vip-common.conf
Source4: vip-up
Source5: vip-down
#Source6: vip-helper.sh
Patch0: ucarp-1.5.2-sighup.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires(post): /sbin/chkconfig
Requires(preun): /sbin/chkconfig, /sbin/service
@ -34,6 +35,7 @@ need for any dedicated extra network link between redundant hosts.
%prep
%setup -q
%patch0 -p0
%build
%configure
@ -98,6 +100,31 @@ fi
%{_sbindir}/ucarp
%changelog
* Sat Mar 05 2016 Jon Ciesla <limburgher@gmail.com> - 1.5.2-9
- Additional init fix, Petr Poky
* Wed Feb 13 2013 Jon Ciesla <limburgher@gmail.com> - 1.5.2-8
- Additional init fix, Trent Johnson.
* Wed Jan 23 2013 Jon Ciesla <limburgher@gmail.com> - 1.5.2-7
- Dropped MASTER from init, BZ 896576.
* Tue Dec 11 2012 Jon Ciesla <limburgher@gmail.com> - 1.5.2-6
- init fix from Alexander Bostrom, BZ 809421.
* Tue Nov 13 2012 Jon Ciesla <limburgher@gmail.com> - 1.5.2-5
- Additional init fix.
* Mon Nov 12 2012 Jon Ciesla <limburgher@gmail.com> - 1.5.2-4
- Init script fixes from Trent Johnson and Dan Bassett at oreilly.com:
- Changed the get_files function in order to allow file names that don't include the ID.
- Moved config sourcing earlier in the script, allowing the ID parameter to be defined in the config, rather than the filename, if desired.
- Added a MASTER parameter option to the config file, allowing a master node to be selected in a deterministic way using the advskew.
- Added the ability to define the SOURCE_ADDRESS either in the config file, or using IPADDR from the ifcfg-$BIND_INTERFACE file.
* Thu Oct 25 2012 Jon Ciesla <limburgher@gmail.com> - 1.5.2-3.1
- Patch for crash.
* 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