From 28e40caed26b12afb46bc291aa8c9fc802cae9a2 Mon Sep 17 00:00:00 2001 From: Dirk Goetz Date: Thu, 25 Feb 2016 20:55:38 +0100 Subject: [PATCH] RPM: Add firewalld service fixes #10718 --- icinga2.spec | 24 ++++++++++++++++++++++++ tools/firewalld/icinga2.xml | 7 +++++++ 2 files changed, 31 insertions(+) create mode 100644 tools/firewalld/icinga2.xml diff --git a/icinga2.spec b/icinga2.spec index 72d2e35a3..a468338ea 100644 --- a/icinga2.spec +++ b/icinga2.spec @@ -107,6 +107,13 @@ BuildRequires: bison BuildRequires: make %if 0%{?fedora} BuildRequires: wxGTK3-devel +BuildRequires: firewalld-filesystem +Requires: firewalld-filesystem +Requires(post): firewalld-filesystem +%endif +%if 0%{?rhel} == 7 +Requires: firewalld +Requires(post): firewalld %endif %if 0%{?build_icinga_org} && "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6") @@ -366,6 +373,11 @@ Categories=GTK;Utility; Keywords=Monitoring;" > %{buildroot}%{_datadir}/applications/icinga2-studio.desktop %endif +%if 0%{?fedora} || 0%{?rhel} == 7 +mkdir -p %{buildroot}%{_prefix}/lib/firewalld/services +install -p -m 644 tools/firewalld/%{name}.xml %{buildroot}%{_prefix}/lib/firewalld/services +%endif + %clean [ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot} @@ -396,6 +408,14 @@ getent passwd %{icinga_user} >/dev/null || %{_sbindir}/useradd -c "icinga" -s /s %endif #suse/rhel +%if 0%{?fedora} +%firewalld_reload +%endif +%if 0%{?rhel} == 7 +test -f /usr/bin/firewall-cmd && firewall-cmd --reload --quiet || : +%endif + + %post common # suse %if "%{_vendor}" == "suse" @@ -598,6 +618,10 @@ fi %attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name} %attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd +%if 0%{?fedora} || 0%{?rhel} == 7 +%{_prefix}/lib/firewalld/services/%{name}.xml +%endif + %files libs %defattr(-,root,root,-) %doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog diff --git a/tools/firewalld/icinga2.xml b/tools/firewalld/icinga2.xml new file mode 100644 index 000000000..eb15d3aa2 --- /dev/null +++ b/tools/firewalld/icinga2.xml @@ -0,0 +1,7 @@ + + + Icinga2 + Icinga 2 is an open source monitoring system which checks the availability of your network resources, notifies users of outages, and generates performance data for reporting. Enable this for API, cluster and agent communication. + + + -- 2.40.0