From d5ea70207754ab6d5fef27c22312102280824c38 Mon Sep 17 00:00:00 2001 From: Matthias Saou Date: Sun, 12 Apr 2009 17:07:57 +0000 Subject: [PATCH] Update to 1.1.17 and update init script all the way. --- .cvsignore | 2 +- keepalived.init | 117 +++++++++++++++++++++++++++++------------------- keepalived.spec | 14 +++--- sources | 2 +- 4 files changed, 82 insertions(+), 53 deletions(-) diff --git a/.cvsignore b/.cvsignore index 6f4397f..451c4d9 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -keepalived-1.1.15.tar.gz +keepalived-1.1.17.tar.gz diff --git a/keepalived.init b/keepalived.init index eaf93bc..53909dd 100755 --- a/keepalived.init +++ b/keepalived.init @@ -1,85 +1,110 @@ #!/bin/sh # -# Startup script for the Keepalived daemon -# chkconfig: - 21 79 -# description: HA monitor built upon LVS, VRRP and service pollers -# processname: keepalived -# config: /etc/keepalived/keepalived.conf -# config: /etc/sysconfig/keepalived -# pidfile: /var/run/keepalived.pid +# keepalived High Availability monitor built upon LVS and VRRP # +# chkconfig: - 21 79 +# description: Robust keepalive facility to the Linux Virtual Server project \ +# with multilayer TCP/IP stack checks. + ### BEGIN INIT INFO # Provides: keepalived -# Required-Start: $local_fs $network $named -# Required-Stop: $local_fs $remote_fs $network -# Short-Description: HA monitor built upon LVS, VRRP and service pollers -# Description: Robust keepalive facility to the Linux Virtual Server project -# with multilayer TCP/IP stack checks. +# Required-Start: $local_fs $network $named $syslog +# Required-Stop: $local_fs $network $named $syslog +# Should-Start: httpd +# Should-Stop: httpd +# Default-Start: +# Default-Stop: 0 1 2 3 4 5 6 +# Short-Description: High Availability monitor built upon LVS and VRRP +# Description: Robust keepalive facility to the Linux Virtual Server +# project with multilayer TCP/IP stack checks. ### END INIT INFO -# Source function library +# Source function library. . /etc/rc.d/init.d/functions -# Source configuration file (we set KEEPALIVED_OPTIONS there) -. /etc/sysconfig/keepalived - -RETVAL=0 - +exec="/usr/sbin/keepalived" prog="keepalived" +config="/etc/keepalived/keepalived.conf" + +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog + +lockfile=/var/lock/subsys/$prog start() { + [ -x $exec ] || exit 5 + [ -e $config ] || exit 6 echo -n $"Starting $prog: " - daemon keepalived ${KEEPALIVED_OPTIONS} - RETVAL=$? + daemon $exec $KEEPALIVED_OPTIONS + retval=$? echo - [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog + [ $retval -eq 0 ] && touch $lockfile + return $retval } stop() { echo -n $"Stopping $prog: " - killproc keepalived - RETVAL=$? + killproc $prog + retval=$? echo - [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() { + stop + start } reload() { echo -n $"Reloading $prog: " - killproc keepalived -1 - RETVAL=$? + killproc $prog -1 + retval=$? echo + return $retval } -# See how we were called. +force_reload() { + restart +} + +rh_status() { + status $prog +} + +rh_status_q() { + rh_status &>/dev/null +} + + case "$1" in start) - start + rh_status_q && exit 0 + $1 ;; stop) - stop - ;; - reload|force-reload) - reload + rh_status_q || exit 0 + $1 ;; restart) - stop - start + $1 ;; - condrestart|try-restart) - if [ -f /var/lock/subsys/$prog ]; then - stop - start - else - echo $"Service $prog not running." - exit 7 - fi + reload) + rh_status_q || exit 7 + $1 + ;; + force-reload) + force_reload ;; status) - status keepalived + rh_status + ;; + condrestart|try-restart) + rh_status_q || exit 0 + restart ;; *) - echo "Usage: $0 {start|stop|reload|force-reload|restart|try-restart|status}" - exit 3 + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" + exit 2 esac +exit $? -exit $RETVAL diff --git a/keepalived.spec b/keepalived.spec index 563cdf5..474293a 100644 --- a/keepalived.spec +++ b/keepalived.spec @@ -3,8 +3,8 @@ Summary: HA monitor built upon LVS, VRRP and service pollers Name: keepalived -Version: 1.1.15 -Release: 8%{?dist} +Version: 1.1.17 +Release: 1%{?dist} License: GPLv2+ Group: Applications/System URL: http://www.keepalived.org/ @@ -39,7 +39,7 @@ healthchecks and LVS directors failover. %prep %setup -q %patch0 -p1 -b .installmodes -# Fix file mode (600 as of 1.1.13) +# Fix file mode (600 as of 1.1.13, still as of 1.1.17) %{__chmod} a+r doc/samples/sample.misccheck.smbcheck.sh # Included as doc, so disable its dependencies %{__chmod} -x goodies/arpreset.pl @@ -57,7 +57,7 @@ KERNELDIR=$(ls -1d /lib/modules/%{kernel}*/build | head -1) %{__make} install DESTDIR=%{buildroot} # Remove "samples", as we include them in %%doc %{__rm} -rf %{buildroot}%{_sysconfdir}/keepalived/samples/ -# Overwrite the init script with our (mostly) LSB compliant one +# Overwrite the init script with our LSB compliant one %{__install} -p -m 0755 %{SOURCE1} \ %{buildroot}%{_sysconfdir}/rc.d/init.d/keepalived @@ -106,7 +106,11 @@ fi %changelog -* Wed Feb 25 2009 Fedora Release Engineering - 1.1.15-8 +* Sun Apr 12 2009 Matthias Saou 1.1.17-1 +- Update to 1.1.17. +- Update init script all the way. + +* Wed Feb 25 2009 Fedora Release Engineering - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Jan 17 2009 Tomas Mraz 1.1.15-7 diff --git a/sources b/sources index 9726841..45cda45 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -4c93f5d8b6bfabe84b02828a5bbb7aa0 keepalived-1.1.15.tar.gz +324ef61a9eed389679f0a05edd1d1323 keepalived-1.1.17.tar.gz