From patchwork Thu Jun 30 10:15:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robin Roevens X-Patchwork-Id: 5715 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 4LYZ4c5YfVz40TL for ; Thu, 30 Jun 2022 10:16:48 +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 4LYZ4X4YRlz1Xt; Thu, 30 Jun 2022 10:16:44 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4LYZ4X26vZz302b; Thu, 30 Jun 2022 10:16:44 +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 4LYZ4W5Yfmz2yWQ for ; Thu, 30 Jun 2022 10:16:43 +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 4LYZ4V35n8z1Xt for ; Thu, 30 Jun 2022 10:16:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 376AE459B8 for ; Thu, 30 Jun 2022 12:16:42 +0200 (CEST) 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 OppIpTyBboFN for ; Thu, 30 Jun 2022 12:16:40 +0200 (CEST) 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 5ADE04B9E8; Thu, 30 Jun 2022 12:16:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1656584195; bh=f8XkDKQneRrDCCvJ+GIBT3C0Boa25nTnsEhLcDPiNhM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RgdMPY7aq24mJ/bQbbzrtlAVvKF+tJmd3yXNEYDRX4WEhwAcJg080BrZ0OVC4J2Pw +evbkZ1rByofSBsfPLoBV4mnY96JPBLPR4RQwH5LqbxSZ9CbJXdsDl/Tqrkw4ku2Bx ZRESyAU+FTb2uNFRI3nJlZtD3KLdTX8XRkadKNdN1UoGaLLylOsnc4731onFpZx6P/ xiQPbsYgnKSwqD6nBOooEs/ZMBSIe31KozusMhqqh24aO0K+CCCist1ua7BKRMKndc QSNrUml2R+jO2lfX3T0ACi8thWP//NKursQekMXqnPZZI2jrYC0BDn2w3XFOvKSpKJ tzmmYLXBeLcjg== From: Robin Roevens To: development@lists.ipfire.org Subject: [PATCH v5 2/6] zabbix_agentd: Fix agent modules dir and few minor bugs Date: Thu, 30 Jun 2022 12:15:51 +0200 Message-Id: <20220630101555.13438-3-robin.roevens@disroot.org> In-Reply-To: <20220630101555.13438-1-robin.roevens@disroot.org> References: <20220630101555.13438-1-robin.roevens@disroot.org> Mime-Version: 1.0 X-sicho-MailScanner-ID: 5ADE04B9E8.A8A80 X-sicho-MailScanner: Found to be clean X-sicho-MailScanner-From: robin.roevens@disroot.org X-sicho-MailScanner-Watermark: 1657188971.74527@Q2UUr+UtuqghXKEsNq/jlw ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1656584202; a=rsa-sha256; cv=none; b=DGBSxDUE9BUYN0EkPsmdyiCq9iL/apYlXekAohXnybmcdnkWDvHxE39LlBNRk9BMC3+LWZ +X6tUmiKjQLbDh7OiHiUk9SN5mj6CoM0XqmQFCkYoSFr9mY1A0/+RVxxXiecfAr+VXeiaV uVjwB3SdaJTDTvCy76MZUE4LF406svsnpRvpDAS17to8ZQPiR+YwF29G4aZZAFdNWy6aFa EMB19AUmCaYDk8N175B82rv9m9ZXP93PaNWRaYg7nYV3tEF9h/0MaW5GoiZBNxfv94NEU0 kdUr9m9am+uHhCf17RgTVoY0nX/FnbMoWGBqiK23TnPBVcs1hBc0+OzKlduAnw== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=RgdMPY7a; 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; dmarc=pass (policy=quarantine) header.from=disroot.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1656584202; 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=k9BfLJB5wL/3mCqgdjRHMBfgIC1Xxf9odhDKHdlfGuQ=; b=Psk/C3YEeaWSgn5WHKuWz1WurB/aP+G2ghGPfbz2hCbFVlQ45ipW/1gorQot8WAuRQ1MEo Ap0jFPuxOcFKUiu9JEBydjbpTuyppmq+lA+e/4c7DaO+33mrooVQV5xBiEKz6f8KbHDDl/ LOTP89QhO1qPzFLRnDBCHJI0wJSoQHaSlxYL2LEbjppO1T4OhEANbiA4yo+4PZq0iZ2zp+ 3PMywVbPiN3n2M7tu9B+Ffif2t2uVVJodW8UaR4vvCFZSX9hd2CnFQ2VZcs9IkNl6+cWFv cu1nYTl/39V1VodSVK1Fcj6llL3JTAJAlvcNDpVPsB6snaxHNbVARiSTL/K2OQ== X-Spamd-Result: default: False [-6.39 / 11.00]; REPLY(-4.00)[]; BAYES_HAM(-2.99)[99.96%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM(-1.00)[-1.000]; SPF_REPUTATION_HAM(-0.78)[-0.78380193243943]; R_MISSING_CHARSET(0.50)[]; BAD_REP_POLICIES(0.50)[]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; URIBL_PBL(0.01)[121.152.53.14:update.sh:url]; MX_GOOD(-0.01)[]; IP_REPUTATION_HAM(-0.01)[asn: 50673(0.00), country: NL(-0.01), ip: 178.21.23.139(0.00)]; R_DKIM_ALLOW(0.00)[disroot.org:s=mail]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; RCVD_COUNT_THREE(0.00)[4]; 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)[] Authentication-Results: mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=RgdMPY7a; 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; dmarc=pass (policy=quarantine) header.from=disroot.org X-Rspamd-Queue-Id: 4LYZ4V35n8z1Xt X-Rspamd-Server: mail01.haj.ipfire.org 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