From patchwork Thu Mar 3 21:02:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Roevens X-Patchwork-Id: 5311 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) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4K8k3k34Hhz3xK1 for ; Thu, 3 Mar 2022 21:03:30 +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 4K8k3h3GqWz5Wr; Thu, 3 Mar 2022 21:03:28 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4K8k3h30tYz2yXK; Thu, 3 Mar 2022 21:03:28 +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 4K8k3g6s3Zz2yRM for ; Thu, 3 Mar 2022 21:03:27 +0000 (UTC) Received: from knopi.disroot.org (knopi.disroot.org [178.21.23.139]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4K8k3g0h0Rz5ZH for ; Thu, 3 Mar 2022 21:03:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id C8DF08EB9E for ; Thu, 3 Mar 2022 22:03:26 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CIiqb5PxrXpr for ; Thu, 3 Mar 2022 22:03:25 +0100 (CET) Received: from chojin.sicho.home (amaterasu.sicho.home [192.168.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (no client certificate requested) (Authenticated sender) by hachiman (MailScanner Milter) with SMTP id 45CA6184CB; Thu, 3 Mar 2022 22:03:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1646341405; bh=pJV37aI6E168++qTH+D9yNksIFfe8w7l/jE95vYdBAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CcX0ZD0JICci0tL9sawmBIJa7p/sRR3F4XbDryGLMVRv+VWl1ngAC1SWoytLRv8+m fE23mw4gADBnzFxQLsPB9ThdCdjeCZpMHe/uIuJ7L+YXzzDE+YBmfjOH1Gj9neFX7L TExOj482bhZCrtwbknoep9Vus1hoTd6m/b2xj4xu64hY974trz2mExEO5m2x+6/Amk kU3C/x/Fi0J/C/7M/UXHnnFy5MPEKfM44uEE73YWNG6gtHWbQNix2ArT6wcms1vItJ JipjbKvE1F04t8TG+sGMXEKfr8hZRb70xk4sZ6M74JbHdmtHRszklakG1tUlmYJHHW 8a6XCluZOzr8A== From: Robin Roevens To: development@lists.ipfire.org Subject: [PATCH v4 2/6] zabbix_agentd: Fix agent modules dir and few minor bugs Date: Thu, 3 Mar 2022 22:02:50 +0100 Message-Id: <20220303210254.3116-3-robin.roevens@disroot.org> In-Reply-To: <20220303210254.3116-1-robin.roevens@disroot.org> References: <20220303210254.3116-1-robin.roevens@disroot.org> Mime-Version: 1.0 X-sicho-MailScanner-ID: 45CA6184CB.A8A80 X-sicho-MailScanner: Found to be clean X-sicho-MailScanner-From: robin.roevens@disroot.org X-sicho-MailScanner-Watermark: 1646946187.5336@pEeHuVYvn03NcZh4Q5BqKw ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1646341407; a=rsa-sha256; cv=none; b=b34FisUcdwwtMnj2ROUK4y9wqpu1idxYz1PgObfkHpwWURAgfx2xRhuHfEeH0Ff1jUeZpZ 3HdGsALY8CEme2r3y1qfYif/KYJploERxcMCYHt7BBwM4Wee7DYUFdO5xptGKtxbPmkdva Y39hbeOPFI1LfM6kv15AhHQg2KtOLFtYtA9RAeU3txBf/3cpi59YwKN8dbktFD7gvmu36m Bwnlb7PDAooTTKZbso/NTjLaana1aBqNnKelHxdlQmVDFGUiDuXgjyaF/Ccf5p5UsZv+qG AlFgVYyy2YBVfVnjFs0vFpXwnq+qBOhw1dHGPIOEJyC6wTEPRIiDZp3EqjRFWQ== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=CcX0ZD0J; dmarc=pass (policy=quarantine) header.from=disroot.org; spf=pass (mail01.ipfire.org: domain of robin.roevens@disroot.org designates 178.21.23.139 as permitted sender) smtp.mailfrom=robin.roevens@disroot.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1646341407; 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:dkim-signature; bh=ang1wjwrmqmIahKAFrEd1uUGUw1bgGvTFE2S8QzgfcU=; b=jqgUNCIRaZ96sSeBJcHV494gZs+Ujem3zQtmXYWZcZgnK2iI5UMFickQMt1ooFa+OTDM1g MsGSwjTSCQ0aTdsV8Y9+2gmFsG3QLmnC0Ap/I+TF05NxJxUh6mcGPdjoAbddyvMSPsYei8 iV3dyLKqJP0mHMxteEo4CRYJB+/qcktjXAUHxMfP0ZXYlsUj6SWRGD8Xm3gA0+BizpFUSS s2zGbnmbxIEG8igEpEACq5bgn3ktp4ELd1jLCmAJBBES0lV+NSxpW7elnRd/A4X3aUDxAK 2u+PB1Ko6akNXqbtZOc84uyxc00CutP8W06g1pxk8bKZ7wTNfyqpAuz/jMthlg== Authentication-Results: mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=CcX0ZD0J; dmarc=pass (policy=quarantine) header.from=disroot.org; spf=pass (mail01.ipfire.org: domain of robin.roevens@disroot.org designates 178.21.23.139 as permitted sender) smtp.mailfrom=robin.roevens@disroot.org X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-3.31 / 11.00]; BAYES_HAM(-3.00)[99.99%]; IP_REPUTATION_HAM(-1.16)[asn: 50673(-0.33), country: NL(-0.01), ip: 178.21.23.139(-0.82)]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-0.99)[-0.990]; SPF_REPUTATION_HAM(-0.65)[-0.65416940988521]; R_MISSING_CHARSET(0.50)[]; URIBL_PBL(0.50)[121.152.53.14:update.sh:url]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; BAD_REP_POLICIES(0.10)[]; MX_GOOD(-0.01)[]; R_DKIM_ALLOW(0.00)[disroot.org:s=mail]; TO_MATCH_ENVRCPT_SOME(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; RCVD_TLS_LAST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_THREE(0.00)[4]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; R_SPF_ALLOW(0.00)[+a:c]; ASN(0.00)[asn:50673, ipnet:178.21.23.0/24, country:NL]; DKIM_TRACE(0.00)[disroot.org:+]; DMARC_POLICY_ALLOW(0.00)[disroot.org,quarantine]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_SOME(0.00)[] X-Rspamd-Queue-Id: 4K8k3g0h0Rz5ZH 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" - Add agent modules-dir to backup - Remove original, not used agent modules dir from rootfile - Create modules-dir during install if it not already exists - bugfix: Add existence check before creating log-dir, avoiding error messages if it already exists from a previous install - bugfix: add extract_backup_includes to update.sh script to make sure backup includes exist when backup is taken. Signed-off-by: Robin Roevens --- config/backup/includes/zabbix_agentd | 3 ++- config/rootfiles/packages/zabbix_agentd | 2 +- src/paks/zabbix_agentd/install.sh | 4 ++-- src/paks/zabbix_agentd/update.sh | 1 + 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/config/backup/includes/zabbix_agentd b/config/backup/includes/zabbix_agentd index cba18d772..d3305cb96 100644 --- a/config/backup/includes/zabbix_agentd +++ b/config/backup/includes/zabbix_agentd @@ -1,2 +1,3 @@ /etc/sudoers.d/zabbix -/etc/zabbix_agentd/* +/etc/zabbix_agentd/ +/usr/lib/zabbix/ diff --git a/config/rootfiles/packages/zabbix_agentd b/config/rootfiles/packages/zabbix_agentd index 4420bda05..d9bbc3ccf 100644 --- a/config/rootfiles/packages/zabbix_agentd +++ b/config/rootfiles/packages/zabbix_agentd @@ -8,7 +8,7 @@ etc/zabbix_agentd/zabbix_agentd.d etc/zabbix_agentd/zabbix_agentd.d/userparameter_pakfire.conf usr/bin/zabbix_get usr/bin/zabbix_sender -usr/lib/modules +#usr/lib/modules usr/lib/zabbix usr/sbin/zabbix_agentd #usr/share/man/man1/zabbix_get.1 diff --git a/src/paks/zabbix_agentd/install.sh b/src/paks/zabbix_agentd/install.sh index e1450a1d8..cf435918d 100644 --- a/src/paks/zabbix_agentd/install.sh +++ b/src/paks/zabbix_agentd/install.sh @@ -39,8 +39,8 @@ ln -sf ../init.d/zabbix_agentd /etc/rc.d/rc0.d/K02zabbix_agentd ln -sf ../init.d/zabbix_agentd /etc/rc.d/rc6.d/K02zabbix_agentd # Create additonal directories and set permissions -mkdir -pv /var/log/zabbix -chown zabbix.zabbix /var/log/zabbix +[ -d /var/log/zabbix ] || ( mkdir -pv /var/log/zabbix && chown zabbix.zabbix /var/log/zabbix ) +[ -d /usr/lib/zabbix ] || ( mkdir -pv /usr/lib/zabbix && chown zabbix.zabbix /usr/lib/zabbix ) restore_backup ${NAME} start_service --background ${NAME} diff --git a/src/paks/zabbix_agentd/update.sh b/src/paks/zabbix_agentd/update.sh index 7fc1c96fb..68bba4f80 100644 --- a/src/paks/zabbix_agentd/update.sh +++ b/src/paks/zabbix_agentd/update.sh @@ -22,6 +22,7 @@ ############################################################################ # . /opt/pakfire/lib/functions.sh +extract_backup_includes ./uninstall.sh ./install.sh