From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 2/2] clamav: Add scriptlets to handle systemd service files. Date: Sun, 12 Feb 2023 16:20:13 +0100 Message-ID: <20230212152013.386417-2-stefan.schantl@ipfire.org> In-Reply-To: <20230212152013.386417-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============4311970257619920423==" List-Id: --===============4311970257619920423== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Fixes #11603. Signed-off-by: Stefan Schantl --- clamav/clamav.nm | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/clamav/clamav.nm b/clamav/clamav.nm index 14765e000..f941bc6b9 100644 --- a/clamav/clamav.nm +++ b/clamav/clamav.nm @@ -82,9 +82,42 @@ packages %{name}-libs =3D %{thisver} end =20 + configfiles + %{sysconfdir}/clamd.conf + %{sysconfdir}/freshclam.conf + end + + prerequires + systemd-units + end + script prein %{create_users} end + + script postin + systemctl daemon-reload >/dev/null 2>&1 || : + systemctl enable clamav-freshclam.service >/dev/null 2>&1 || : + systemctl enable clamav-daemon.service >/dev/null 2>&1 || : + end + + script preun + systemctl --no-reload disable clamav-freshclam.service >/dev/null 2>&1 ||= : + systemctl --no-reload disable clamav-daemon.service >/dev/null 2>&1 ||: + + systemctl stop clamav-freshclam.service.service >/dev/null 2>&1 || : + systemctl stop clamav-daemon.service >/dev/null 2>&1 || : + end + + script postun + systemctl daemon-reload >/dev/null 2>&1 || : + end + + script postup + systemctl daemon-reload >/dev/null 2>&1 || : + systemctl try-restart clamav-freshclam.service >/dev/null 2>&1 || : + systemctl try-restart clamav-daemon.service >/dev/null 2>&1 || : + end end =20 package %{name}-libs --=20 2.30.2 --===============4311970257619920423==--