Fork the init script to be (mostly for now) LSB compliant (#246966).

This commit is contained in:
Matthias Saou 2008-12-24 14:56:52 +00:00
parent 82524dc937
commit 8cb068987e
2 changed files with 95 additions and 3 deletions

85
keepalived.init Executable file
View File

@ -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

View File

@ -4,11 +4,12 @@
Summary: HA monitor built upon LVS, VRRP and service pollers Summary: HA monitor built upon LVS, VRRP and service pollers
Name: keepalived Name: keepalived
Version: 1.1.15 Version: 1.1.15
Release: 5%{?dist} Release: 6%{?dist}
License: GPLv2+ License: GPLv2+
Group: Applications/System Group: Applications/System
URL: http://www.keepalived.org/ 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 Patch0: keepalived-1.1.14-installmodes.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Requires(post): /sbin/chkconfig Requires(post): /sbin/chkconfig
@ -56,6 +57,9 @@ KERNELDIR=$(ls -1d /lib/modules/%{kernel}*/build | head -1)
%{__make} install DESTDIR=%{buildroot} %{__make} install DESTDIR=%{buildroot}
# Remove "samples", as we include them in %%doc # Remove "samples", as we include them in %%doc
%{__rm} -rf %{buildroot}%{_sysconfdir}/keepalived/samples/ %{__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 %check
@ -102,6 +106,9 @@ fi
%changelog %changelog
* Mon Dec 22 2008 Matthias Saou <http://freshrpms.net/> 1.1.15-6
- Fork the init script to be (mostly for now) LSB compliant (#246966).
* Thu Apr 24 2008 Matthias Saou <http://freshrpms.net/> 1.1.15-5 * Thu Apr 24 2008 Matthias Saou <http://freshrpms.net/> 1.1.15-5
- Add glob to the kerneldir location, since it contains the arch for F9+. - Add glob to the kerneldir location, since it contains the arch for F9+.