diff --git a/keepalived.init b/keepalived.init new file mode 100755 index 0000000..eaf93bc --- /dev/null +++ b/keepalived.init @@ -0,0 +1,85 @@ +#!/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 +# +### 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. +### END INIT INFO + +# Source function library +. /etc/rc.d/init.d/functions + +# Source configuration file (we set KEEPALIVED_OPTIONS there) +. /etc/sysconfig/keepalived + +RETVAL=0 + +prog="keepalived" + +start() { + echo -n $"Starting $prog: " + daemon keepalived ${KEEPALIVED_OPTIONS} + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && touch /var/lock/subsys/$prog +} + +stop() { + echo -n $"Stopping $prog: " + killproc keepalived + RETVAL=$? + echo + [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog +} + +reload() { + echo -n $"Reloading $prog: " + killproc keepalived -1 + RETVAL=$? + echo +} + +# See how we were called. +case "$1" in + start) + start + ;; + stop) + stop + ;; + reload|force-reload) + reload + ;; + restart) + stop + start + ;; + condrestart|try-restart) + if [ -f /var/lock/subsys/$prog ]; then + stop + start + else + echo $"Service $prog not running." + exit 7 + fi + ;; + status) + status keepalived + ;; + *) + echo "Usage: $0 {start|stop|reload|force-reload|restart|try-restart|status}" + exit 3 +esac + +exit $RETVAL diff --git a/keepalived.spec b/keepalived.spec index 2a6ef7b..8e95a6a 100644 --- a/keepalived.spec +++ b/keepalived.spec @@ -4,11 +4,12 @@ Summary: HA monitor built upon LVS, VRRP and service pollers Name: keepalived Version: 1.1.15 -Release: 5%{?dist} +Release: 6%{?dist} License: GPLv2+ Group: Applications/System URL: http://www.keepalived.org/ -Source: http://www.keepalived.org/software/keepalived-%{version}.tar.gz +Source0: http://www.keepalived.org/software/keepalived-%{version}.tar.gz +Source1: keepalived.init Patch0: keepalived-1.1.14-installmodes.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root Requires(post): /sbin/chkconfig @@ -56,6 +57,9 @@ 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 +%{__install} -p -m 0755 %{SOURCE1} \ + %{buildroot}%{_sysconfdir}/rc.d/init.d/keepalived %check @@ -102,6 +106,9 @@ fi %changelog +* Mon Dec 22 2008 Matthias Saou 1.1.15-6 +- Fork the init script to be (mostly for now) LSB compliant (#246966). + * Thu Apr 24 2008 Matthias Saou 1.1.15-5 - Add glob to the kerneldir location, since it contains the arch for F9+. @@ -109,7 +116,7 @@ fi - Autorebuild for GCC 4.3 * Wed Dec 05 2007 Release Engineering - - Rebuild for deps +- Rebuild for deps * Mon Oct 22 2007 Matthias Saou 1.1.15-2 - Update to latest upstream sources, identical except for the included spec.