From bd72ca7abba7ed89cd04fb3c757a691cab2f50e4 Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Thu, 12 Mar 2015 08:05:57 +0200 Subject: [PATCH] RPM: Patch systemd service for CentOS7 & fix broken filesystem attributes --- centos/rspamd.spec | 12 +++++++----- centos/sources/rspamd.service | 6 ------ centos/sources/rspamd.service.patch | 9 +++++++++ 3 files changed, 16 insertions(+), 11 deletions(-) delete mode 100644 centos/sources/rspamd.service create mode 100644 centos/sources/rspamd.service.patch diff --git a/centos/rspamd.spec b/centos/rspamd.spec index a1058c6fb..52bf31ea3 100644 --- a/centos/rspamd.spec +++ b/centos/rspamd.spec @@ -55,10 +55,10 @@ Source0: https://rspamd.com/downloads/%{name}-%{version}.tar.xz %if 0%{?el6} Source1: %{name}.init Source2: %{name}.logrotate -%else -Source3: %{name}.service %endif +Patch0: %{name}.service.patch + %description Rspamd is a rapid, modular and lightweight spam filter. It is designed to work with big amount of mail and can be easily extended with own filters written in @@ -97,8 +97,6 @@ lua. %{__install} -d -p -m 0755 %{buildroot}%{_localstatedir}/run/rspamd %{__install} -p -D -m 0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/logrotate.d/%{name} %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir} -%else -%{__install} -p -D -m 0644 %{SOURCE3} %{buildroot}%{_unitdir}/%{name}.service %endif %{__install} -d -p -m 0755 %{buildroot}%{rspamd_home} @@ -115,6 +113,10 @@ rm -rf %{buildroot} %service_add_pre %{name}.socket %endif +%if 0%{?el7} +%patch0 -p0 +%endif + %post %if 0%{?suse_version} %service_add_post %{name}.service @@ -191,7 +193,7 @@ fi %if 0%{?el6} %dir %{rspamd_logdir} %endif -%attr(-, rspamd, rspamd) %dir %{rspamd_home} +%attr(-, _rspamd, _rspamd) %dir %{rspamd_home} %dir %{rspamd_confdir}/lua/regexp %dir %{rspamd_confdir}/lua %dir %{rspamd_confdir} diff --git a/centos/sources/rspamd.service b/centos/sources/rspamd.service deleted file mode 100644 index 14545569a..000000000 --- a/centos/sources/rspamd.service +++ /dev/null @@ -1,6 +0,0 @@ -[Unit] -Description=rapid spam filtering system -After=nss-lookup.target - -[Service] -ExecStart=/usr/bin/rspamd -c /etc/rspamd/rspamd.conf -f -u _rspamd -g _rspamd diff --git a/centos/sources/rspamd.service.patch b/centos/sources/rspamd.service.patch new file mode 100644 index 000000000..c3c05fbbb --- /dev/null +++ b/centos/sources/rspamd.service.patch @@ -0,0 +1,9 @@ +--- rspamd.service.orig 2015-03-12 07:59:13.779172699 +0200 ++++ rspamd.service 2015-03-12 08:00:20.443173489 +0200 +@@ -3,5 +3,4 @@ + After=nss-lookup.target + + [Service] +-ExecStart=/usr/bin/rspamd -c /etc/rspamd/rspamd.conf -f +-User=_rspamd ++ExecStart=/usr/bin/rspamd -c /etc/rspamd/rspamd.conf -f -u _rspamd -g _rspamd -- 2.39.5