-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlbclient.spec.tpl
138 lines (116 loc) · 5.06 KB
/
lbclient.spec.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
%global provider gitlab
%global provider_tld cern.ch
%global project lb-experts
%global provider_full %{provider}.%{provider_tld}/%{project}
%global repo golbclient
%global import_path %{provider_full}/%{repo}
%global gopath %{_datadir}/gocode
%global debug_package %{nil}
Name: lbclient
Version: #REPLACE_BY_VERSION#
Release: #REPLACE_BY_RELEASE#%{?dist}
Summary: CERN DNS Load Balancer Client
License: ASL 2.0
URL: https://github.com/cernops/%{repo}
Source: %{name}-%{version}.tgz
BuildRequires: golang >= 1.13
BuildRequires: checkpolicy
%if 0%{?el6}%{?el7}
BuildRequires: policycoreutils-python
%else
BuildRequires: policycoreutils-python-utils
%endif
ExclusiveArch: x86_64
Requires: net-snmp
%description
%{summary}
This is a concurrent implementation of the CERN LB client.
The load balancing daemon dynamically handles the list of machines behind a
given DNS alias to allow scaling and improve availability.
The Domain Name System (DNS), the defacto standard for name resolution and
esential for the network, is an open standard based protocol which allows
the use of names instead of IP addresses on the network.
Load balancing is an advanced function that can be provided by DNS, to load
balance requests across several machines running the same service by using
the same DNS name.
The load balancing server requests each machine for its load status.
The SNMP daemon, gets the request and calls the locally installed metric
program, which delivers the load value in SNMP syntax to STDOUT. The SNMP
daemon then passes this back to the load balancing server.
The lowest loaded machine names are updated on the DNS servers via the
DynDNS mechanism.
%prep
%setup -n %{name}-%{version} -q
%if 0%{?rhel} >= 7
cp -p config/cc7-lbclient.te config/lbclient.te
%endif
%if 0%{?rhel} == 6
cp -p config/slc6-lbclient.te config/lbclient.te
%endif
checkmodule -M -m -o config/lbclient.mod config/lbclient.te
semodule_package -m config/lbclient.mod -o config/lbclient.pp
%build
go build -o lbclient -mod=vendor
%install
# main package binary
install -d -p %{buildroot}/usr/local/sbin/ %{buildroot}/usr/share/selinux/targeted/ %{buildroot}/usr/local/etc/ %{buildroot}/usr/sbin/
install -p -m0755 lbclient %{buildroot}/usr/sbin/lbclient
install -p config/lbclient.pp %{buildroot}/usr/share/selinux/targeted/lbclient.pp
cd %{buildroot}/usr/local/sbin && ln -s ../../sbin/lbclient
echo "load constant -1" > %{buildroot}/usr/local/etc/lbclient.conf
%preun
# remove all the files if this is the last package removed (not upgraded)
if [ "$1" == 0 ] ; then
semodule -r lbclient
fi
%post
semodule -i /usr/share/selinux/targeted/lbclient.pp
%files
%doc LICENSE COPYING README.md
/usr/sbin/lbclient
/usr/local/sbin/lbclient
/usr/share/selinux/targeted/lbclient.pp
%config(noreplace) /usr/local/etc/lbclient.conf
%changelog
* Wed Dec 08 2021 Pablo Saiz <[email protected]> - 2.2.1-3
- New check for scheduled reboots
* Fri Apr 23 2021 Ignacio Reguero <[email protected]> - 2.2.1-2
- Accept new eos mountpoint configuration
* Mon Mar 22 2021 Ignacio Reguero <[email protected]> - 2.2.1-0
- Fix the checks of collectd-alarms
* Tue Jan 12 2021 Ignacio Reguero <[email protected]> - 2.2.0-5
- Add rule to SElinux policy for collectd_var_run_t sock_file write to address problem in hap11
* Wed Dec 02 2020 Ignacio Reguero <[email protected]> - 2.2.0-4
- Accept dots in collectd metric names to allow cvmfs checks
* Mon Nov 30 2020 Ignacio Reguero <[email protected]> - 2.2.0-3
- Allow check for /eos/user and /eos/project
* Wed Oct 14 2020 Ignacio Reguero <[email protected]> - 2.2.0-1
- New check for EOS
* Wed Aug 05 2020 Pablo Saiz <[email protected]> - 2.1.3-2
- Move to rpmci
* Mon Jul 06 2020 Pablo Saiz <[email protected]> - 2.1.3
- Removal of the selinux when the rpm is removed
* Tue Oct 08 2019 Pablo Saiz <[email protected]> - 2.1.2
- Adding a default configuration to disable lbclient
* Thu Sep 05 2019 Pablo Saiz <[email protected]> - 2.1.1
- Generic check daemons check tcp4 and tcp6
* Wed Sep 04 2019 Paulo Canilho <[email protected]> - 2.1.0
- Fixed the [command] check returned errors to prevent failures during the [-t] puppet install
- Added a test to check the executable output format
- Implemented the [collectd_alarms] as a type of check
- Implemented a new logger; now using [logrus]
* Fri Mar 08 2019 Paulo Canilho <[email protected]> - 2.0.8
- File logger
- Generilized the parameterized checks
* Tue Mar 05 2019 Ignacio reguero <[email protected]> - 2.0.7
- In collectd, we can specify the name of the anchor
* Thu Feb 28 2019 Pablo Saiz <[email protected]> - 2.0.5
- Collectd support
* Thu Feb 21 2019 Pablo Saiz <[email protected]> - 2.0.3
- Include the link in /usr/local/sbin/lbclient
* Wed Feb 13 2019 Pablo Saiz <[email protected]> - 2.0.2
- Copying the old configuration file
* Tue Feb 05 2019 Paulo Canilho <[email protected]> - 0.0.2
- Setting up the post install
* Fri Jun 15 2018 Pablo Saiz <[email protected]> - 0.0.1
- First version of the rpm