From patchwork Sun Feb 12 15:20:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6513 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PFB4B3jNkz3ws7 for ; Sun, 12 Feb 2023 15:20:26 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4PFB4875Mgz1Dk; Sun, 12 Feb 2023 15:20:24 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PFB480JZdz2xBD; Sun, 12 Feb 2023 15:20:24 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4PFB463xPQz2xY8 for ; Sun, 12 Feb 2023 15:20:22 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4PFB461TtMzdM; Sun, 12 Feb 2023 15:20:22 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1676215222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RKcZyHBFvCXVPaSLnsv+ADfrB4WuUjurZqv4OfI+PVg=; b=VmZ55N1V5/67oG4l6P0EQXEgfWCd+n6u/VN52aeH7QHz0sSTD7nBSvU4sS3+Brd+gB8oF3 ZYZL4divlmw5JTBw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1676215222; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RKcZyHBFvCXVPaSLnsv+ADfrB4WuUjurZqv4OfI+PVg=; b=jNLBdPQ+HbUTmIVk+ah7GfHu9FiJKyXxuy0sihDtYdB4RHBTAtxd7OURE9H6clUepwgNSC XhyphGDaUzobdxQZGctWoqup3Q2pJBtB71BHSowYlXl2NSTCXbM/uYM+d5MnVcOrjgS9TM yH7C0C+f8BXq5v1OuhPUkbyFy8lN0MJdSPYEoIrws7HBxdHaGRmhSEEChPqwpHYbkm1gp1 WZxyi01i1afGOaCUYv3xE3bLKVoHXApVStjsE8i7YQ27FaLJPb8PFqqFvRtGKs41LoMhqh 6tX5KlwbF9SlHu8bIrCpY9fd01GiXUWzK/fGBgotVxagCer9vNij4s+jnH4DSw== 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> References: <20230212152013.386417-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" 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 = %{thisver} end + 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 package %{name}-libs