diff --git a/clamav-5.6.2-el6-service.patch b/clamav-5.6.2-el6-service.patch new file mode 100644 index 0000000..de06cf7 --- /dev/null +++ b/clamav-5.6.2-el6-service.patch @@ -0,0 +1,43 @@ +From 882507f36af3ac6cb9c9332b7d34dcec6d12d38e Mon Sep 17 00:00:00 2001 +From: Robert Scheck +Date: Fri, 8 Mar 2019 14:45:02 +0100 +Subject: [PATCH] Use `/sbin/service` rather `service` and `reload` rather + `restart for RHEL/CentOS 6 + +By default RHEL/CentOS 6 doesn't have `/sbin` in `$PATH`, thus `service clamd restart` +poorly fails by default. Aside of that, a `reload` rather a `restart` is sufficient for +ClamAV as well to reload the ClamAV databases (worked already for years now). If at all +this should be turned into `condrestart` rather `restart`, because RHEL/CentOS 6 might +not use `/etc/init.d/clamd` service at all, but `/etc/init.d/clamd.amavisd` service; +which gets relevant when ClamAV is used only for Amavisd-New, but not for the actual +system...nobody would like to see a maybe unused service to be started by a cronjob... +--- + config/os.centos6-cpanel.conf | 2 +- + config/os.centos6.conf | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/config/os.centos6-cpanel.conf b/config/os.centos6-cpanel.conf +index 02ed033..6ac3044 100644 +--- a/config/os.centos6-cpanel.conf ++++ b/config/os.centos6-cpanel.conf +@@ -27,7 +27,7 @@ clam_dbs="/usr/local/cpanel/3rdparty/share/clamav" + + clamd_pid="/var/run/clamav/clamd.pid" + +-clamd_restart_opt="service clamd restart" ++clamd_restart_opt="/sbin/service clamd reload" + + #clamd_socket="/var/run/clamd.socket" + +diff --git a/config/os.centos6.conf b/config/os.centos6.conf +index af48428..fab6495 100644 +--- a/config/os.centos6.conf ++++ b/config/os.centos6.conf +@@ -27,7 +27,7 @@ clam_dbs="/var/lib/clamav" + + clamd_pid="/var/run/clamav/clamd.pid" + +-clamd_restart_opt="service clamd restart" ++clamd_restart_opt="/sbin/service clamd reload" + + #clamd_socket="/var/run/clamd.socket" diff --git a/clamav-unofficial-sigs.spec b/clamav-unofficial-sigs.spec index 1a67f26..94c8649 100644 --- a/clamav-unofficial-sigs.spec +++ b/clamav-unofficial-sigs.spec @@ -38,6 +38,9 @@ INetMsg and ScamNailer. %prep %setup -qn %{name}-%{version} +%if 0%{?rhel} && 0%{?rhel} < 7 +%patch0 -p1 +%endif sed -i -e '/user_configuration_complete/ s/^#//' config/user.conf sed -i -e '/ExecStart/ s^/usr/local/sbin^/usr/sbin^' systemd/clamav-unofficial-sigs.service