Commit 2895ae42 authored by Henrik Triem's avatar Henrik Triem
Browse files

Add icingadb-redis package

parent bd18df98
Pipeline #7888 passed with stages
in 13 minutes and 42 seconds
This diff is collapsed.
[Unit]
Description=Redis persistent key-value database for IcingaDB
After=network.target
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/icinga-redis-server /etc/icinga2/icingadb-redis.conf --supervised systemd
ExecStop=/usr/libexec/icinga-redis-shutdown
Type=notify
User=icinga-redis
Group=icinga-redis
RuntimeDirectory=icinga-redis
RuntimeDirectoryMode=0755
[Install]
WantedBy=multi-user.target
[Unit]
Description=Redis for Icinga DB
After=network.target
[Service]
Type=notify
User=icinga-redis
Group=icinga-redis
PrivateTmp=true
PIDFile=/var/run/icinga2/icingadb-redis.pid
ExecStart=/usr/sbin/icinga-redis-server /etc/icinga2/icingadb-redis.conf
LimitNOFILE=10240
Restart=on-failure
[Install]
WantedBy=multi-user.target
......@@ -41,6 +41,10 @@ License: GPLv2+
URL: https://%{provider_prefix}
Source0: https://%{import_path}/archive/v%{version}.tar.gz
Source1: icingadb-redis.service.suse
Source2: icingadb-redis.service.rhel
Source3: icingadb-redis.conf
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
BuildRequires: %{?golang_scl_prefix}%{golang_pkg} >= %{golang_min_version}
......@@ -69,6 +73,14 @@ Requires(pre): shadow-utils
%description
Icinga DB
%package redis
Summary: Icinga Redis for Icinga DB
Group: System/Monitoring
Requires: icinga-redis
%description redis
Redis service for Icinga DB.
%prep
%setup -q
......@@ -100,6 +112,16 @@ install -d -m 0755 %{buildroot}%{_datadir}/%{name}
ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
%endif # suse
#%%install redis
# Install custom systemd service file for icingadb-redis. Source1 is SUSE, Source2 is RHEL.
%if "%{_vendor}" == "suse"
install -D -m 0644 %{SOURCE1} %{buildroot}%{_unitdir}/icingadb-redis.service
%else
install -D -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/icingadb-redis.service
%endif
install -D -m 0640 %{SOURCE3} %{buildroot}%{_sysconfdir}/icinga-redis/icingadb-redis.conf
%pre
getent group icingadb >/dev/null || groupadd -r icingadb
getent passwd icingadb >/dev/null || useradd -r -g icingadb -d / -s /sbin/nologin -c 'Icinga DB' icingadb
......@@ -108,6 +130,11 @@ getent passwd icingadb >/dev/null || useradd -r -g icingadb -d / -s /sbin/nologi
%service_add_pre %{service}
%endif # suse
%pre redis
%if "%{_vendor}" == "suse"
%service_add_pre icingadb-redis.service
%endif
%post
%if "%{_vendor}" == "suse"
%service_add_post %{service}
......@@ -115,6 +142,15 @@ getent passwd icingadb >/dev/null || useradd -r -g icingadb -d / -s /sbin/nologi
%systemd_post %{service}
%endif # suse
%post redis
%if "%{_vendor}" == "suse"
%fillup_only icingadb-redis
%service_add_post icingadb-redis.service
%else
# rhel
%systemd_post icingadb-redis.service
%endif
%preun
%if "%{_vendor}" == "suse"
%service_del_preun %{service}
......@@ -122,6 +158,15 @@ getent passwd icingadb >/dev/null || useradd -r -g icingadb -d / -s /sbin/nologi
%systemd_preun %{service}
%endif # suse
%preun redis
# suse
%if "%{_vendor}" == "suse"
%service_del_preun icingadb-redis.service
%else # rhel
%systemd_preun icingadb-redis.service
%endif # suse / rhel
exit 0
%postun
%if "%{_vendor}" == "suse"
%service_del_postun %{service}
......@@ -129,6 +174,15 @@ getent passwd icingadb >/dev/null || useradd -r -g icingadb -d / -s /sbin/nologi
%systemd_postun %{service}
%endif # suse
%postun redis
# suse
%if "%{_vendor}" == "suse"
%service_del_postun icingadb-redis.service
%else # rhel
%systemd_postun_with_restart icingadb-redis.service
%endif # suse / rhel
exit 0
%clean
rm -rf %{buildroot}
......@@ -150,6 +204,13 @@ rm -rf %{buildroot}
%dir %{configdir}
%config(noreplace) %{configdir}/icingadb.ini
%files redis
%defattr(-,root,root,-)
#%%doc AUTHORS COPYING README.md
%config(noreplace) %attr(0640,icinga-redis,icinga-redis) %{_sysconfdir}/icinga-redis/icingadb-redis.conf
%attr(644,root,root) %{_unitdir}/icingadb-redis.service
%changelog
* Fri Dec 13 2019 Henrik Triem <henrik.triem@icinga.com> 0.0.0-1
* Mon Sep 24 2018 Markus Frosch <markus.frosch@icinga.com> 0.0.0-0
- Initial package
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment