Browse code

Adding package keepalived and supporting package libnfnetlink

Change-Id: I3fdd08a5a1a92ce90a370dbd0941d4b3384e45f1
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2379
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Alexey Makhalov <amakhalov@vmware.com>

DheerajSShetty authored on 2017/04/12 05:51:24
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,15 @@
0
+[Unit]
1
+Description=LVS and VRRP High Availability Monitor
2
+After=syslog.target network-online.target
3
+Wants=network-online.target
4
+
5
+[Service]
6
+Type=forking
7
+PIDFile=/var/run/keepalived.pid
8
+KillMode=process
9
+EnvironmentFile=-/etc/sysconfig/keepalived
10
+ExecStart=/usr/sbin/keepalived $KEEPALIVED_OPTIONS
11
+ExecReload=/bin/kill -HUP $MAINPID
12
+
13
+[Install]
14
+WantedBy=multi-user.target
0 15
new file mode 100644
... ...
@@ -0,0 +1,89 @@
0
+Summary:    HA monitor built upon LVS, VRRP and services poller 
1
+Name:       keepalived
2
+Version:    1.3.5
3
+Release:    1%{?dist}
4
+License:    GPL
5
+URL:        http://www.keepalived.org/
6
+Group:      Applications/System
7
+Vendor:     VMware, Inc.
8
+Distribution: Photon
9
+Source0:     http://www.keepalived.org/software/%{name}-%{version}.tar.gz
10
+%define sha1 keepalived=5a373d8f5d382700cf53b827947a92a7f4cef148
11
+Source1:     keepalived.service
12
+BuildRequires:    openssl-devel
13
+BuildRequires:    iptables
14
+BuildRequires:    libmnl-devel
15
+BuildRequires:    ipset-devel
16
+BuildRequires:    libnl-devel
17
+BuildRequires:    libnfnetlink-devel
18
+BuildRequires:    net-snmp-devel
19
+BuildRequires:    systemd
20
+Requires:         systemd
21
+
22
+%description
23
+The main goal of the keepalived project is to add a strong & robust keepalive
24
+facility to the Linux Virtual Server project. This project is written in C with
25
+multilayer TCP/IP stack checks. Keepalived implements a framework based on
26
+three family checks : Layer3, Layer4 & Layer5/7. This framework gives the
27
+daemon the ability to check the state of an LVS server pool. When one of the
28
+servers of the LVS server pool is down, keepalived informs the linux kernel via
29
+a setsockopt call to remove this server entry from the LVS topology. In
30
+addition keepalived implements an independent VRRPv2 stack to handle director
31
+failover. So in short keepalived is a userspace daemon for LVS cluster nodes
32
+healthchecks and LVS directors failover.
33
+
34
+%prep
35
+%setup -q
36
+
37
+%build
38
+./configure \
39
+    --prefix=%{_prefix}	\
40
+    --bindir=%{_bindir}	\
41
+    --libdir=%{_libdir}	\
42
+    --sysconfdir=%{_sysconfdir} \
43
+    --with-systemdsystemunitdir=%{_unitdir} \
44
+    --enable-snmp       \
45
+    --enable-snmp-rfc
46
+make %{?_smp_mflags} STRIP=/bin/true
47
+
48
+%install
49
+make install DESTDIR=%{buildroot}
50
+install -p -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/keepalived.service
51
+rm -rf %{buildroot}%{_sysconfdir}/keepalived/samples/*
52
+
53
+%check
54
+# A build could silently have LVS support disabled if the kernel includes can't
55
+# be properly found, we need to avoid that.
56
+if ! grep -q "#define _WITH_LVS_ *1" lib/config.h; then
57
+    %{__echo} "ERROR: We do not want keepalived lacking LVS support."
58
+    exit 1
59
+fi
60
+
61
+%post
62
+/sbin/ldconfig
63
+%systemd_post keepalived.service
64
+
65
+%preun
66
+%systemd_preun keepalived.service
67
+
68
+%postun
69
+/sbin/ldconfig
70
+%systemd_postun_with_restart keepalived.service
71
+
72
+%files
73
+%defattr(-,root,root)
74
+%{_sbindir}/keepalived
75
+%{_bindir}/genhash
76
+%{_unitdir}/keepalived.service
77
+%config(noreplace) %{_sysconfdir}/sysconfig/keepalived
78
+%config(noreplace) %{_sysconfdir}/keepalived/keepalived.conf
79
+%{_datadir}/snmp/mibs/KEEPALIVED-MIB.txt
80
+%{_datadir}/snmp/mibs/VRRP-MIB.txt
81
+%{_datadir}/snmp/mibs/VRRPv3-MIB.txt
82
+%{_mandir}/man1/genhash.1*
83
+%{_mandir}/man5/keepalived.conf.5*
84
+%{_mandir}/man8/keepalived.8*
85
+
86
+%changelog
87
+*   Thu Apr 06 2017 Dheeraj Shetty <dheerajs@vmware.com> 1.3.5-1
88
+-   Initial build.  First version