summaryrefslogtreecommitdiff
path: root/community/keepalived
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2011-12-07 23:14:52 +0000
committerroot <root@rshg054.dnsready.net>2011-12-07 23:14:52 +0000
commit6f9a9504db6338f0c35c4ca70bad42965b74791a (patch)
tree8cd9006f99ed08350063a734502b77e1d0ee7db4 /community/keepalived
parent8736f458a17a03cf79a763a0c8122f93162fed71 (diff)
Wed Dec 7 23:14:52 UTC 2011
Diffstat (limited to 'community/keepalived')
-rw-r--r--community/keepalived/PKGBUILD44
-rw-r--r--community/keepalived/ip_vs_moved.patch23
-rw-r--r--community/keepalived/keepalived.conf16
-rw-r--r--community/keepalived/keepalived.rc39
4 files changed, 122 insertions, 0 deletions
diff --git a/community/keepalived/PKGBUILD b/community/keepalived/PKGBUILD
new file mode 100644
index 000000000..79361ec90
--- /dev/null
+++ b/community/keepalived/PKGBUILD
@@ -0,0 +1,44 @@
+# $Id$
+# Maintainer: Sebastien Luttringer <seblu+arch@seblu.net
+# Contributor: Andrea Zucchelli <zukka77@gmail.com>
+
+pkgname=keepalived
+pkgver=1.2.2
+pkgrel=1
+pkgdesc='implements an independent VRRPv2 stack and a userspace daemon for LVS cluster nodes healthchecks and LVS directors failover'
+arch=('i686' 'x86_64')
+url='http://www.keepalived.org/'
+license=('GPL2')
+backup=('etc/keepalived/keepalived.conf' 'etc/conf.d/keepalived')
+depends=('openssl' 'popt' 'libnl')
+source=("http://www.keepalived.org/software/$pkgname-$pkgver.tar.gz"
+ 'keepalived.rc'
+ 'keepalived.conf'
+ 'ip_vs_moved.patch')
+md5sums=('f68327ca142616a8463d2d105db122cd'
+ 'baeb62a682c2b59d732cea84bf52cc87'
+ '9c8142da8730ad27a345587dea83ced7'
+ '87ee19c85adaedd3eb11bea8a5865d47')
+
+build() {
+ cd $pkgname-$pkgver
+ patch -p1 -i ../ip_vs_moved.patch
+ ./configure --prefix=/usr --sysconfdir=/etc
+ make
+}
+
+package() {
+ # add initscripts
+ install -D -m 755 $pkgname.rc "${pkgdir}/etc/rc.d/$pkgname"
+ install -D -m 644 $pkgname.conf "${pkgdir}/etc/conf.d/$pkgname"
+
+ cd $pkgname-$pkgver
+ make DESTDIR="$pkgdir" install
+ # clean pacakge init scripts
+ rm -r "$pkgdir/etc/rc.d/init.d" "$pkgdir/etc/sysconfig"
+ # move examples to /usr/share
+ install -d -m 755 "$pkgdir/usr/share/$pkgname"
+ mv "$pkgdir/etc/keepalived/samples" "$pkgdir/usr/share/$pkgname/samples"
+}
+
+# vim:set ts=2 sw=2 ft=sh et:
diff --git a/community/keepalived/ip_vs_moved.patch b/community/keepalived/ip_vs_moved.patch
new file mode 100644
index 000000000..e27873810
--- /dev/null
+++ b/community/keepalived/ip_vs_moved.patch
@@ -0,0 +1,23 @@
+--- keepalived-1.2.2/configure 2011-01-06 01:51:33.000000000 +0100
++++ keepalived-1.2.2.orig/configure 2011-11-24 19:36:32.051486626 +0100
+@@ -3973,7 +3973,7 @@
+
+ IPVS_SUPPORT="_WITHOUT_LVS_"
+ if test "$enable_lvs" != "no"; then
+- ac_fn_c_check_header_mongrel "$LINENO" "net/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default"
++ ac_fn_c_check_header_mongrel "$LINENO" "linux/ip_vs.h" "ac_cv_header_net_ip_vs_h" "$ac_includes_default"
+ if test "x$ac_cv_header_net_ip_vs_h" = x""yes; then :
+ IPVS_SUPPORT="_WITH_LVS_"
+ else
+diff -ru keepalived-1.2.2/configure.in keepalived-1.2.2.orig/configure.in
+--- keepalived-1.2.2/configure.in 2011-01-06 01:51:30.000000000 +0100
++++ keepalived-1.2.2.orig/configure.in 2011-11-24 19:36:11.797860077 +0100
+@@ -124,7 +124,7 @@
+ dnl ----[ Checks for LVS and VRRP support ]----
+ IPVS_SUPPORT="_WITHOUT_LVS_"
+ if test "$enable_lvs" != "no"; then
+- AC_CHECK_HEADER([net/ip_vs.h],
++ AC_CHECK_HEADER([linux/ip_vs.h],
+ [IPVS_SUPPORT="_WITH_LVS_"],
+ [
+ IPVS_SUPPORT="_WITHOUT_LVS_"
diff --git a/community/keepalived/keepalived.conf b/community/keepalived/keepalived.conf
new file mode 100644
index 000000000..225f02bf9
--- /dev/null
+++ b/community/keepalived/keepalived.conf
@@ -0,0 +1,16 @@
+# vim:set ts=2 sw=2 ft=sh et:
+# Options for keepalived. See `keepalived --help' output and keepalived(8) and
+# keepalived.conf(5) man pages for a list of all options. Here are the most
+# common ones :
+#
+# --vrrp -P Only run with VRRP subsystem.
+# --check -C Only run with Health-checker subsystem.
+# --dont-release-vrrp -V Dont remove VRRP VIPs & VROUTEs on daemon stop.
+# --dont-release-ipvs -I Dont remove IPVS topology on daemon stop.
+# --dump-conf -d Dump the configuration data.
+# --log-detail -D Detailed log messages.
+# --log-facility -S 0-7 Set local syslog facility (default=LOG_DAEMON)
+#
+
+DAEMON_OPTS='-D'
+
diff --git a/community/keepalived/keepalived.rc b/community/keepalived/keepalived.rc
new file mode 100644
index 000000000..88bb90724
--- /dev/null
+++ b/community/keepalived/keepalived.rc
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/${0##*/}
+
+NAME=keepalived
+DAEMON=/usr/sbin/keepalived
+PID=$(pidof -o %PPID $DAEMON)
+
+case "$1" in
+ start)
+ stat_busy "Starting $NAME daemon"
+ [[ ! $PID ]] && $DAEMON $DAEMON_OPTS && add_daemon $NAME && stat_done && exit 0
+ stat_fail
+ ;;
+ stop)
+ stat_busy "Stopping $NAME daemon"
+ [[ $PID ]] && kill $PID &> /dev/null && rm_daemon $NAME && stat_done && exit 0
+ stat_fail
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ exit 0
+ ;;
+ reload)
+ stat_busy "Reloading $NAME daemon"
+ [[ $PID ]] && kill -HUP $PID &> /dev/null && stat_done && exit 0
+ stat_fail
+ ;;
+ *)
+ echo "usage: ${0##*/} {start|stop|restart|reload}" >&2
+ ;;
+esac
+
+exit 1
+
+# vim:set ts=2 sw=2 ft=sh noet: