icinga2: Add systemd limits.conf on systemd > 228

Also see:
* https://github.com/Icinga/icinga2/issues/5611
* https://github.com/Icinga/icinga2/pull/5612
This commit is contained in:
Markus Frosch 2017-09-28 16:40:34 +02:00
parent 7f39bb5a16
commit 45a20b93cc
2 changed files with 33 additions and 1 deletions

View File

@ -0,0 +1,9 @@
# Icinga 2 sets some default values to extend OS defaults
#
# Please refer to our troubleshooting documentations for details
# and reasons on these values.
[Service]
TasksMax=infinity
# May also cause problems, uncomment if you have any
#LimitNPROC=62883

View File

@ -40,6 +40,12 @@
%else
# fedora and el>=7
%define use_systemd 1
%if 0%{?fedora} >= 24
# for installing limits.conf on systemd >= 228
%define configure_systemd_limits 1
%else
%define configure_systemd_limits 0
%endif
%endif
%endif
@ -51,6 +57,12 @@
%define apachegroup www
%if 0%{?suse_version} >= 1310
%define use_systemd 1
%if 0%{?suse_version} >= 120200 && 0%{?is_opensuse}
# for installing limits.conf on systemd >= 228
%define configure_systemd_limits 1
%else
%define configure_systemd_limits 0
%endif
%else
%define use_systemd 0
%endif
@ -72,9 +84,12 @@ Name: icinga2
Version: 2.7.1
Release: %{revision}%{?dist}
License: GPL-2.0+
URL: https://www.icinga.com/
Group: Applications/System
Source: https://github.com/Icinga/%{name}/archive/v%{version}.tar.gz
URL: https://www.icinga.com/
Source1: icinga2.service.limits.conf
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Requires: %{name}-bin = %{version}-%{release}
@ -399,6 +414,11 @@ install -D -m 0644 etc/icinga/icinga-classic-apache.conf %{buildroot}%{apachecon
# DEPRECATED, disable builds on Amazon
%endif
# install custom limits.conf for systemd
%if 0%{?configure_systemd_limits}
install -D -m 0644 etc/initsystem/icinga2.service.limits.conf %{buildroot}%{_userunitdir}/%{name}.service.d/limits.conf
%endif
# remove features-enabled symlinks
rm -f %{buildroot}/%{_sysconfdir}/%{name}/features-enabled/*.conf
@ -716,6 +736,9 @@ fi
%{_sysconfdir}/bash_completion.d/%{name}
%if 0%{?use_systemd}
%attr(644,root,root) %{_unitdir}/%{name}.service
%if 0%{?configure_systemd_limits}
%attr(644,root,root) %{_userunitdir}/%{name}.service.d/limits.conf
%endif
%else
%attr(755,root,root) %{_sysconfdir}/init.d/%{name}
%endif