Commit cd68b700 authored by Noah Hilverling's avatar Noah Hilverling
Browse files

Move Icinga DB Redis package to rpm-icingadb-redis repository

parent f82ac868
Pipeline #19760 passed with stages
in 6 minutes and 50 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/icinga-redis/icingadb-redis.conf
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/icinga-redis/icingadb-redis.pid
ExecStart=/usr/sbin/icinga-redis-server /etc/icinga-redis/icingadb-redis.conf
LimitNOFILE=10240
Restart=on-failure
[Install]
WantedBy=multi-user.target
......@@ -28,10 +28,6 @@ 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: git
......@@ -41,8 +37,6 @@ BuildRequires: systemd
%define debug_package %nil
Requires: icinga-redis
%if "%{_vendor}" == "suse"
PreReq: permissions
Provides: user(icingadb)
......@@ -59,14 +53,6 @@ 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
......@@ -95,19 +81,6 @@ install -d -m 0755 %{buildroot}%{_datadir}/%{name}
ln -sf /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
%endif # suse
#%%install redis
install -d -m 0755 %{buildroot}%{_sharedstatedir}/icinga-redis/icingadb-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 0644 %{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 /etc/icingadb -s /sbin/nologin -c 'Icinga DB' icingadb
......@@ -116,11 +89,6 @@ getent passwd icingadb >/dev/null || useradd -r -g icingadb -d /etc/icingadb -s
%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}
......@@ -128,15 +96,6 @@ getent passwd icingadb >/dev/null || useradd -r -g icingadb -d /etc/icingadb -s
%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}
......@@ -144,15 +103,6 @@ getent passwd icingadb >/dev/null || useradd -r -g icingadb -d /etc/icingadb -s
%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}
......@@ -160,15 +110,6 @@ exit 0
%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}
......@@ -190,13 +131,6 @@ rm -rf %{buildroot}
%dir %{configdir}
%config(noreplace) %{configdir}/config.yml
%files redis
%defattr(-,root,root,-)
#%%doc AUTHORS COPYING README.md
%config(noreplace) %attr(0644,redis,redis) %{_sysconfdir}/icinga-redis/icingadb-redis.conf
%attr(644,root,root) %{_unitdir}/icingadb-redis.service
%dir %attr(755,redis,redis) %{_sharedstatedir}/icinga-redis/icingadb-redis
%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
......
Supports Markdown
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