Message ID | 20210407204455.450-3-robin.roevens@disroot.org |
---|---|
State | Superseded |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> 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 4FFxJp6Zfjz3yBV for <patchwork@web04.haj.ipfire.org>; Wed, 7 Apr 2021 20:46:50 +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 4FFxJp4HsQz20N; Wed, 7 Apr 2021 20:46:50 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FFxJp3S3pz2ygN; Wed, 7 Apr 2021 20:46:50 +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 4FFxJl6N2Pz2xJw for <development@lists.ipfire.org>; Wed, 7 Apr 2021 20:46:47 +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 4FFxJl51PTz20N for <development@lists.ipfire.org>; Wed, 7 Apr 2021 20:46:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 018D150D83 for <development@lists.ipfire.org>; Wed, 7 Apr 2021 22:46:47 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new 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 UTF8SMTP id KGvqGyp3MVVQ for <development@lists.ipfire.org>; Wed, 7 Apr 2021 22:46:45 +0200 (CEST) Received: from amaterasu.sicho.home ([192.168.0.1] helo=chojin.sicho.home) by filekeeper.sicho.home with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <robin.roevens@disroot.org>) id 1lUF3e-0003Zi-1b; Wed, 07 Apr 2021 22:45:50 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1617828378; bh=hHJENc70C0ZHWBG0SKn9sZlG2o96aD+gBzE16qZT55M=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=LfuJcwEgz4HZ+5ru3GfIjKj9WGb8ccVswkV+/lMlNlcJAd+0DMZNejGoY4fkCYxl1 8KE9AGu0BI3vcpn84ppuVM66SLWrFwe3Fa4JUQMMVqSnsLEYu70avGIykK/3JJ0LeS mz1NbWv2EtiNcCRKnEvxfKNi6+XFYThZc5zbFiwABUJTnIIqMV+a4lLrYo4fNgXMtv +opvNy2G43IzwqLivNPku8bnyenPmjxfacr3K2VfkDY8xJFL7c+WLxSOp2+yunUsIq BCkbTwsMbMkxEPKWeiRUlg7jkgtkNZ7g430TVSSNl3eyw2DfNmCMexAq4auFvskTj3 AOK5cmL9/NcCg== From: Robin Roevens <robin.roevens@disroot.org> To: development@lists.ipfire.org Subject: [PATCH 2/4] [V2] zabbix_agentd: Fix agent modules directory Date: Wed, 7 Apr 2021 22:44:54 +0200 Message-Id: <20210407204455.450-3-robin.roevens@disroot.org> In-Reply-To: <20210407204455.450-1-robin.roevens@disroot.org> References: <20210407204455.450-1-robin.roevens@disroot.org> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-filekeeper-MailScanner-ID: 1lUF3e-0003Zi-1b X-filekeeper-MailScanner: Found to be clean X-filekeeper-MailScanner-From: robin.roevens@disroot.org X-filekeeper-MailScanner-Watermark: 1618433155.87873@OqEhs3ft78Pf/IXAZ0/vEw ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1617828407; 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=Zy9o5gMM8JlvyWPmhn+E2m7z/s/UqDK1k3idvRTsP3k=; b=ALPq8P6OoT/HVIvBfpFT1W9WlrZgVVtfqTDaFjOmMMWIcHKoA5cUwCQUT1klD+eCn3PA5r QqQ8o4CER5FlDuHOyXYsF01JvKKGHljJGztKgZouQXVOQge5O+ZgeTHYLXPzAwIX5qhXee UdtoCjDRWsuKHXEov/PcyqDwoCwWx0eRuQUgGReXbz9vcnUw3z9EgHwQKhpoX1MKJyVqX9 rwhhhsiKRpoGU09KZ+iVA0Jb6ay7djA1sDC2CiQgpunE+b5/Am14eOSIItPWb6KXsBvVXB /XjfsU6eQ/km4+yhKkwDVuGvPSOkOVh47+94Xf1OGZ8o0Rfy01cgR9+4C9AW6A== ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1617828407; a=rsa-sha256; cv=none; b=JShi3Jo88bGcGUHpk6Ij/rh5Vh48UjtoJg6F9wNI+ONMiwHWrdGY9XhiRBT3B/1RiiKOtQ 5R228tIITsHX9+NflCwXjmaVNMjY8+dPBiCReqBxxx1BywcPkqdRimg3BhyISFPS136tFZ P2ubxesJ0i4I2lUjWiKHRaIC1eBB00aX5chezs4NqQu1tnRu5q5QZJBOfokYT4JLUpAGwj 4mAzij5iOj0lSn1IVdtdWBBgTdePUSIV3VD87N1A7Mg3sHtwecVBszMGt5xANQ/7o4OHAe u+Bq4Pbve4IIxymdAu+qrdzXpGEDY5i1IBaHufzUz8i4nnFXmXEePhvgve9DfQ== ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=LfuJcwEg; 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-Queue-Id: 4FFxJl51PTz20N Authentication-Results: mail01.ipfire.org; dkim=pass header.d=disroot.org header.s=mail header.b=LfuJcwEg; 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 [-4.76 / 11.00]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[disroot.org:s=mail]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+a:c]; MV_CASE(0.50)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; REPLY(-4.00)[]; BROKEN_CONTENT_TYPE(1.50)[]; R_MISSING_CHARSET(2.50)[]; RCVD_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_SOME(0.00)[]; IP_REPUTATION_HAM(-2.26)[asn: 50673(-0.32), country: NL(-0.01), ip: 178.21.23.139(-0.80)]; DKIM_TRACE(0.00)[disroot.org:+]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; DMARC_POLICY_ALLOW(-0.50)[disroot.org,quarantine]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:50673, ipnet:178.21.23.0/24, country:NL]; BAYES_HAM(-3.00)[99.99%] X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk <development.lists.ipfire.org> List-Unsubscribe: <https://lists.ipfire.org/mailman/options/development>, <mailto:development-request@lists.ipfire.org?subject=unsubscribe> List-Archive: <http://lists.ipfire.org/pipermail/development/> List-Post: <mailto:development@lists.ipfire.org> List-Help: <mailto:development-request@lists.ipfire.org?subject=help> List-Subscribe: <https://lists.ipfire.org/mailman/listinfo/development>, <mailto:development-request@lists.ipfire.org?subject=subscribe> Errors-To: development-bounces@lists.ipfire.org Sender: "Development" <development-bounces@lists.ipfire.org> |
Series |
zabbix_agentd: new maintainer/summary
|
|
Commit Message
Robin Roevens
April 7, 2021, 8:44 p.m. UTC
- Add agent modules-dir to backup
- Remove original, not used agent modules dir from rootfile
- Delete agent modules dir only when empty on uninstall thus keeping
possible user deployed custom module files but removing it if unused.
Signed-off-by: Robin Roevens <robin.roevens@disroot.org>
---
config/backup/includes/zabbix_agentd | 3 ++-
config/rootfiles/packages/zabbix_agentd | 4 ++--
src/paks/zabbix_agentd/install.sh | 2 ++
src/paks/zabbix_agentd/uninstall.sh | 5 +++++
src/paks/zabbix_agentd/update.sh | 1 +
5 files changed, 12 insertions(+), 3 deletions(-)
Comments
Hi Robin, The patches seem fine to me, although again my lack of zabbix knowledge means I can't comment on specifics easily. Only minor general point I had was that the commit message might have more clearly specified that the modules-dir is /usr/lib/zabbix. I had to read through the whole patch to come to that conclusion. Overall these look good patches for your first input. Regards, Adolf On 07/04/2021 22:44, Robin Roevens wrote: > - Add agent modules-dir to backup > - Remove original, not used agent modules dir from rootfile > - Delete agent modules dir only when empty on uninstall thus keeping > possible user deployed custom module files but removing it if unused. > > Signed-off-by: Robin Roevens <robin.roevens@disroot.org> > --- > config/backup/includes/zabbix_agentd | 3 ++- > config/rootfiles/packages/zabbix_agentd | 4 ++-- > src/paks/zabbix_agentd/install.sh | 2 ++ > src/paks/zabbix_agentd/uninstall.sh | 5 +++++ > src/paks/zabbix_agentd/update.sh | 1 + > 5 files changed, 12 insertions(+), 3 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..a938f2605 100644 > --- a/config/rootfiles/packages/zabbix_agentd > +++ b/config/rootfiles/packages/zabbix_agentd > @@ -8,8 +8,8 @@ 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/zabbix > +#usr/lib/modules > +#usr/lib/zabbix > usr/sbin/zabbix_agentd > #usr/share/man/man1/zabbix_get.1 > #usr/share/man/man1/zabbix_sender.1 > diff --git a/src/paks/zabbix_agentd/install.sh b/src/paks/zabbix_agentd/install.sh > index e1450a1d8..b98230ea1 100644 > --- a/src/paks/zabbix_agentd/install.sh > +++ b/src/paks/zabbix_agentd/install.sh > @@ -41,6 +41,8 @@ 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 > +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/uninstall.sh b/src/paks/zabbix_agentd/uninstall.sh > index edff3b818..b771d1f63 100644 > --- a/src/paks/zabbix_agentd/uninstall.sh > +++ b/src/paks/zabbix_agentd/uninstall.sh > @@ -26,5 +26,10 @@ stop_service ${NAME} > make_backup ${NAME} > remove_files > > +# Remove agent modules dir if empty > +if [ -z "$(ls -A /usr/lib/zabbix/)" ]; then > + rmdir /usr/lib/zabbix > +fi > + > # Remove init-scripts and symlinks > rm -rfv /etc/rc.d/rc*.d/*zabbix_agentd > 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 >
Hi Adolf Indeed, I should have explicitly mentioned the modules-dir; the original /usr/lib/modules which was removed from the rootfile and the custom one, introduced by Alex, but not backed up until now: /usr/lib/zabbix/. I have been digging in the mailinglist archives to find out why Alex was using /usr/lib/zabbix/ and thus I was 'deep' into the modules-dirs saga that I considered it 'common knowledge' at that point in time where I committed this change. But of course, it is no common knowledge for you guys :-) I will try to pay more attention to such things in the future. Regards Robin Adolf Belka schreef op vr 09-04-2021 om 21:36 [+0200]: > Hi Robin, > > The patches seem fine to me, although again my lack of zabbix > knowledge means I can't comment on specifics easily. > > Only minor general point I had was that the commit message might have > more clearly specified that the modules-dir is /usr/lib/zabbix. I had > to read through the whole patch to come to that conclusion. > > Overall these look good patches for your first input. > > Regards, > > Adolf > > On 07/04/2021 22:44, Robin Roevens wrote: > > - Add agent modules-dir to backup > > - Remove original, not used agent modules dir from rootfile > > - Delete agent modules dir only when empty on uninstall thus > > keeping > > possible user deployed custom module files but removing it if > > unused. > > > > Signed-off-by: Robin Roevens <robin.roevens@disroot.org> > > --- > > config/backup/includes/zabbix_agentd | 3 ++- > > config/rootfiles/packages/zabbix_agentd | 4 ++-- > > src/paks/zabbix_agentd/install.sh | 2 ++ > > src/paks/zabbix_agentd/uninstall.sh | 5 +++++ > > src/paks/zabbix_agentd/update.sh | 1 + > > 5 files changed, 12 insertions(+), 3 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..a938f2605 100644 > > --- a/config/rootfiles/packages/zabbix_agentd > > +++ b/config/rootfiles/packages/zabbix_agentd > > @@ -8,8 +8,8 @@ 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/zabbix > > +#usr/lib/modules > > +#usr/lib/zabbix > > usr/sbin/zabbix_agentd > > #usr/share/man/man1/zabbix_get.1 > > #usr/share/man/man1/zabbix_sender.1 > > diff --git a/src/paks/zabbix_agentd/install.sh > > b/src/paks/zabbix_agentd/install.sh > > index e1450a1d8..b98230ea1 100644 > > --- a/src/paks/zabbix_agentd/install.sh > > +++ b/src/paks/zabbix_agentd/install.sh > > @@ -41,6 +41,8 @@ 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 > > +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/uninstall.sh > > b/src/paks/zabbix_agentd/uninstall.sh > > index edff3b818..b771d1f63 100644 > > --- a/src/paks/zabbix_agentd/uninstall.sh > > +++ b/src/paks/zabbix_agentd/uninstall.sh > > @@ -26,5 +26,10 @@ stop_service ${NAME} > > make_backup ${NAME} > > remove_files > > > > +# Remove agent modules dir if empty > > +if [ -z "$(ls -A /usr/lib/zabbix/)" ]; then > > + rmdir /usr/lib/zabbix > > +fi > > + > > # Remove init-scripts and symlinks > > rm -rfv /etc/rc.d/rc*.d/*zabbix_agentd > > 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 > > >
Hello, So, this is slightly more complicated. The usual way how we do things is to back up any kind of configuration, uninstall everything, install the new package and then restore the configuration. Having custom files in a system directory is probably going to break this. Is there any way to have custom scripts in /etc/zabbix/… or something similar? -Michael > On 10 Apr 2021, at 22:13, Robin Roevens <robin.roevens@disroot.org> wrote: > > Hi Adolf > > Indeed, I should have explicitly mentioned the modules-dir; the > original /usr/lib/modules which was removed from the rootfile and the > custom one, introduced by Alex, but not backed up until now: > /usr/lib/zabbix/. > I have been digging in the mailinglist archives to find out why Alex > was using /usr/lib/zabbix/ and thus I was 'deep' into the modules-dirs > saga that I considered it 'common knowledge' at that point in time > where I committed this change. But of course, it is no common knowledge > for you guys :-) > I will try to pay more attention to such things in the future. > > Regards > Robin > > Adolf Belka schreef op vr 09-04-2021 om 21:36 [+0200]: >> Hi Robin, >> >> The patches seem fine to me, although again my lack of zabbix >> knowledge means I can't comment on specifics easily. >> >> Only minor general point I had was that the commit message might have >> more clearly specified that the modules-dir is /usr/lib/zabbix. I had >> to read through the whole patch to come to that conclusion. >> >> Overall these look good patches for your first input. >> >> Regards, >> >> Adolf >> >> On 07/04/2021 22:44, Robin Roevens wrote: >>> - Add agent modules-dir to backup >>> - Remove original, not used agent modules dir from rootfile >>> - Delete agent modules dir only when empty on uninstall thus >>> keeping >>> possible user deployed custom module files but removing it if >>> unused. >>> >>> Signed-off-by: Robin Roevens <robin.roevens@disroot.org> >>> --- >>> config/backup/includes/zabbix_agentd | 3 ++- >>> config/rootfiles/packages/zabbix_agentd | 4 ++-- >>> src/paks/zabbix_agentd/install.sh | 2 ++ >>> src/paks/zabbix_agentd/uninstall.sh | 5 +++++ >>> src/paks/zabbix_agentd/update.sh | 1 + >>> 5 files changed, 12 insertions(+), 3 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..a938f2605 100644 >>> --- a/config/rootfiles/packages/zabbix_agentd >>> +++ b/config/rootfiles/packages/zabbix_agentd >>> @@ -8,8 +8,8 @@ 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/zabbix >>> +#usr/lib/modules >>> +#usr/lib/zabbix >>> usr/sbin/zabbix_agentd >>> #usr/share/man/man1/zabbix_get.1 >>> #usr/share/man/man1/zabbix_sender.1 >>> diff --git a/src/paks/zabbix_agentd/install.sh >>> b/src/paks/zabbix_agentd/install.sh >>> index e1450a1d8..b98230ea1 100644 >>> --- a/src/paks/zabbix_agentd/install.sh >>> +++ b/src/paks/zabbix_agentd/install.sh >>> @@ -41,6 +41,8 @@ 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 >>> +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/uninstall.sh >>> b/src/paks/zabbix_agentd/uninstall.sh >>> index edff3b818..b771d1f63 100644 >>> --- a/src/paks/zabbix_agentd/uninstall.sh >>> +++ b/src/paks/zabbix_agentd/uninstall.sh >>> @@ -26,5 +26,10 @@ stop_service ${NAME} >>> make_backup ${NAME} >>> remove_files >>> >>> +# Remove agent modules dir if empty >>> +if [ -z "$(ls -A /usr/lib/zabbix/)" ]; then >>> + rmdir /usr/lib/zabbix >>> +fi >>> + >>> # Remove init-scripts and symlinks >>> rm -rfv /etc/rc.d/rc*.d/*zabbix_agentd >>> 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 >>> >> > > > -- > Dit bericht is gescanned op virussen en andere gevaarlijke > inhoud door MailScanner en lijkt schoon te zijn. >
(forgot to reply to all :-)) Hi In theory, I think I could move the modules dir from current /usr/lib/zabbix to /etc/zabbix_agentd/modules for example. However modules are not planin text config files but rather binary (possibly user-created and compiled) libraries that plug into the agent to extend it's functionality. So I assume a user will probably have the source code of the binary library some place else and could probably easily re-deploy the compiled modules after the backup is restored in a recovery situation. But I figured, as it is in a way a configuration of the agent instance, it should also be backed up, not requiring users to re-deploy those after a recovery. But moving binary files into /etc/... feels a bit awkward.. but technically it could be done. Robin Michael Tremer schreef op ma 12-04-2021 om 11:26 [+0100]: > Hello, > > So, this is slightly more complicated. > > The usual way how we do things is to back up any kind of > configuration, uninstall everything, install the new package and then > restore the configuration. > > Having custom files in a system directory is probably going to break > this. > > Is there any way to have custom scripts in /etc/zabbix/… or something > similar? > > -Michael > > > On 10 Apr 2021, at 22:13, Robin Roevens <robin.roevens@disroot.org> > > wrote: > > > > Hi Adolf > > > > Indeed, I should have explicitly mentioned the modules-dir; the > > original /usr/lib/modules which was removed from the rootfile and > > the > > custom one, introduced by Alex, but not backed up until now: > > /usr/lib/zabbix/. > > I have been digging in the mailinglist archives to find out why > > Alex > > was using /usr/lib/zabbix/ and thus I was 'deep' into the modules- > > dirs > > saga that I considered it 'common knowledge' at that point in time > > where I committed this change. But of course, it is no common > > knowledge > > for you guys :-) > > I will try to pay more attention to such things in the future. > > > > Regards > > Robin > > > > Adolf Belka schreef op vr 09-04-2021 om 21:36 [+0200]: > > > Hi Robin, > > > > > > The patches seem fine to me, although again my lack of zabbix > > > knowledge means I can't comment on specifics easily. > > > > > > Only minor general point I had was that the commit message might > > > have > > > more clearly specified that the modules-dir is /usr/lib/zabbix. I > > > had > > > to read through the whole patch to come to that conclusion. > > > > > > Overall these look good patches for your first input. > > > > > > Regards, > > > > > > Adolf > > > > > > On 07/04/2021 22:44, Robin Roevens wrote: > > > > - Add agent modules-dir to backup > > > > - Remove original, not used agent modules dir from rootfile > > > > - Delete agent modules dir only when empty on uninstall thus > > > > keeping > > > > possible user deployed custom module files but removing it > > > > if > > > > unused. > > > > > > > > Signed-off-by: Robin Roevens <robin.roevens@disroot.org> > > > > --- > > > > config/backup/includes/zabbix_agentd | 3 ++- > > > > config/rootfiles/packages/zabbix_agentd | 4 ++-- > > > > src/paks/zabbix_agentd/install.sh | 2 ++ > > > > src/paks/zabbix_agentd/uninstall.sh | 5 +++++ > > > > src/paks/zabbix_agentd/update.sh | 1 + > > > > 5 files changed, 12 insertions(+), 3 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..a938f2605 100644 > > > > --- a/config/rootfiles/packages/zabbix_agentd > > > > +++ b/config/rootfiles/packages/zabbix_agentd > > > > @@ -8,8 +8,8 @@ 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/zabbix > > > > +#usr/lib/modules > > > > +#usr/lib/zabbix > > > > usr/sbin/zabbix_agentd > > > > #usr/share/man/man1/zabbix_get.1 > > > > #usr/share/man/man1/zabbix_sender.1 > > > > diff --git a/src/paks/zabbix_agentd/install.sh > > > > b/src/paks/zabbix_agentd/install.sh > > > > index e1450a1d8..b98230ea1 100644 > > > > --- a/src/paks/zabbix_agentd/install.sh > > > > +++ b/src/paks/zabbix_agentd/install.sh > > > > @@ -41,6 +41,8 @@ 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 > > > > +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/uninstall.sh > > > > b/src/paks/zabbix_agentd/uninstall.sh > > > > index edff3b818..b771d1f63 100644 > > > > --- a/src/paks/zabbix_agentd/uninstall.sh > > > > +++ b/src/paks/zabbix_agentd/uninstall.sh > > > > @@ -26,5 +26,10 @@ stop_service ${NAME} > > > > make_backup ${NAME} > > > > remove_files > > > > > > > > +# Remove agent modules dir if empty > > > > +if [ -z "$(ls -A /usr/lib/zabbix/)" ]; then > > > > + rmdir /usr/lib/zabbix > > > > +fi > > > > + > > > > # Remove init-scripts and symlinks > > > > rm -rfv /etc/rc.d/rc*.d/*zabbix_agentd > > > > 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 > > > > > > > > > > > > > -- > > Dit bericht is gescanned op virussen en andere gevaarlijke > > inhoud door MailScanner en lijkt schoon te zijn. > > > >
Hello, I agree, /etc isn’t exactly the best place for it, but it comes with a couple of benefits: * We will include those files in the backup (or at least should be doing so) * We have control over /usr/lib/zabbix and can do whatever we need there (I was assuming that there are some system files in there - if that is wrong and there is nothing in this directory apart from user files, we can leave it as /usr/lib/zabbix) -Michael > On 12 Apr 2021, at 11:50, Robin Roevens <robin.roevens@disroot.org> wrote: > > (forgot to reply to all :-)) > > Hi > > In theory, I think I could move the modules dir from current > /usr/lib/zabbix to /etc/zabbix_agentd/modules for example. > > However modules are not planin text config files but rather binary > (possibly user-created and compiled) libraries that plug into the agent > to extend it's functionality. So I assume a user will probably have the > source code of the binary library some place else and could probably > easily re-deploy the compiled modules after the backup is restored in a > recovery situation. But I figured, as it is in a way a configuration of > the agent instance, it should also be backed up, not requiring users to > re-deploy those after a recovery. > But moving binary files into /etc/... feels a bit awkward.. but > technically it could be done. > > Robin > > Michael Tremer schreef op ma 12-04-2021 om 11:26 [+0100]: >> Hello, >> >> So, this is slightly more complicated. >> >> The usual way how we do things is to back up any kind of >> configuration, uninstall everything, install the new package and then >> restore the configuration. >> >> Having custom files in a system directory is probably going to break >> this. >> >> Is there any way to have custom scripts in /etc/zabbix/… or something >> similar? >> >> -Michael >> >>> On 10 Apr 2021, at 22:13, Robin Roevens <robin.roevens@disroot.org> >>> wrote: >>> >>> Hi Adolf >>> >>> Indeed, I should have explicitly mentioned the modules-dir; the >>> original /usr/lib/modules which was removed from the rootfile and >>> the >>> custom one, introduced by Alex, but not backed up until now: >>> /usr/lib/zabbix/. >>> I have been digging in the mailinglist archives to find out why >>> Alex >>> was using /usr/lib/zabbix/ and thus I was 'deep' into the modules- >>> dirs >>> saga that I considered it 'common knowledge' at that point in time >>> where I committed this change. But of course, it is no common >>> knowledge >>> for you guys :-) >>> I will try to pay more attention to such things in the future. >>> >>> Regards >>> Robin >>> >>> Adolf Belka schreef op vr 09-04-2021 om 21:36 [+0200]: >>>> Hi Robin, >>>> >>>> The patches seem fine to me, although again my lack of zabbix >>>> knowledge means I can't comment on specifics easily. >>>> >>>> Only minor general point I had was that the commit message might >>>> have >>>> more clearly specified that the modules-dir is /usr/lib/zabbix. I >>>> had >>>> to read through the whole patch to come to that conclusion. >>>> >>>> Overall these look good patches for your first input. >>>> >>>> Regards, >>>> >>>> Adolf >>>> >>>> On 07/04/2021 22:44, Robin Roevens wrote: >>>>> - Add agent modules-dir to backup >>>>> - Remove original, not used agent modules dir from rootfile >>>>> - Delete agent modules dir only when empty on uninstall thus >>>>> keeping >>>>> possible user deployed custom module files but removing it >>>>> if >>>>> unused. >>>>> >>>>> Signed-off-by: Robin Roevens <robin.roevens@disroot.org> >>>>> --- >>>>> config/backup/includes/zabbix_agentd | 3 ++- >>>>> config/rootfiles/packages/zabbix_agentd | 4 ++-- >>>>> src/paks/zabbix_agentd/install.sh | 2 ++ >>>>> src/paks/zabbix_agentd/uninstall.sh | 5 +++++ >>>>> src/paks/zabbix_agentd/update.sh | 1 + >>>>> 5 files changed, 12 insertions(+), 3 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..a938f2605 100644 >>>>> --- a/config/rootfiles/packages/zabbix_agentd >>>>> +++ b/config/rootfiles/packages/zabbix_agentd >>>>> @@ -8,8 +8,8 @@ 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/zabbix >>>>> +#usr/lib/modules >>>>> +#usr/lib/zabbix >>>>> usr/sbin/zabbix_agentd >>>>> #usr/share/man/man1/zabbix_get.1 >>>>> #usr/share/man/man1/zabbix_sender.1 >>>>> diff --git a/src/paks/zabbix_agentd/install.sh >>>>> b/src/paks/zabbix_agentd/install.sh >>>>> index e1450a1d8..b98230ea1 100644 >>>>> --- a/src/paks/zabbix_agentd/install.sh >>>>> +++ b/src/paks/zabbix_agentd/install.sh >>>>> @@ -41,6 +41,8 @@ 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 >>>>> +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/uninstall.sh >>>>> b/src/paks/zabbix_agentd/uninstall.sh >>>>> index edff3b818..b771d1f63 100644 >>>>> --- a/src/paks/zabbix_agentd/uninstall.sh >>>>> +++ b/src/paks/zabbix_agentd/uninstall.sh >>>>> @@ -26,5 +26,10 @@ stop_service ${NAME} >>>>> make_backup ${NAME} >>>>> remove_files >>>>> >>>>> +# Remove agent modules dir if empty >>>>> +if [ -z "$(ls -A /usr/lib/zabbix/)" ]; then >>>>> + rmdir /usr/lib/zabbix >>>>> +fi >>>>> + >>>>> # Remove init-scripts and symlinks >>>>> rm -rfv /etc/rc.d/rc*.d/*zabbix_agentd >>>>> 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 >>>>> >>>> >>> >>> >>> -- >>> Dit bericht is gescanned op virussen en andere gevaarlijke >>> inhoud door MailScanner en lijkt schoon te zijn. >>> >> >> > > > -- > Dit bericht is gescanned op virussen en andere gevaarlijke > inhoud door MailScanner en lijkt schoon te zijn. >
Hi That directory is purely meant for user-modules and by default is empty as nor we, nor Zabbix ship user-modules with the agent. And I don't see that changing in the near future. So currently indeed only user-files will be located there. Robin Michael Tremer schreef op ma 12-04-2021 om 11:52 [+0100]: > Hello, > > I agree, /etc isn’t exactly the best place for it, but it comes with > a couple of benefits: > > * We will include those files in the backup (or at least should be > doing so) > > * We have control over /usr/lib/zabbix and can do whatever we need > there (I was assuming that there are some system files in there - if > that is wrong and there is nothing in this directory apart from user > files, we can leave it as /usr/lib/zabbix) > > -Michael > > > On 12 Apr 2021, at 11:50, Robin Roevens <robin.roevens@disroot.org> > > wrote: > > > > (forgot to reply to all :-)) > > > > Hi > > > > In theory, I think I could move the modules dir from current > > /usr/lib/zabbix to /etc/zabbix_agentd/modules for example. > > > > However modules are not planin text config files but rather binary > > (possibly user-created and compiled) libraries that plug into the > > agent > > to extend it's functionality. So I assume a user will probably have > > the > > source code of the binary library some place else and could > > probably > > easily re-deploy the compiled modules after the backup is restored > > in a > > recovery situation. But I figured, as it is in a way a > > configuration of > > the agent instance, it should also be backed up, not requiring > > users to > > re-deploy those after a recovery. > > But moving binary files into /etc/... feels a bit awkward.. but > > technically it could be done. > > > > Robin > > > > Michael Tremer schreef op ma 12-04-2021 om 11:26 [+0100]: > > > Hello, > > > > > > So, this is slightly more complicated. > > > > > > The usual way how we do things is to back up any kind of > > > configuration, uninstall everything, install the new package and > > > then > > > restore the configuration. > > > > > > Having custom files in a system directory is probably going to > > > break > > > this. > > > > > > Is there any way to have custom scripts in /etc/zabbix/… or > > > something > > > similar? > > > > > > -Michael > > > > > > > On 10 Apr 2021, at 22:13, Robin Roevens > > > > <robin.roevens@disroot.org> > > > > wrote: > > > > > > > > Hi Adolf > > > > > > > > Indeed, I should have explicitly mentioned the modules-dir; the > > > > original /usr/lib/modules which was removed from the rootfile > > > > and > > > > the > > > > custom one, introduced by Alex, but not backed up until now: > > > > /usr/lib/zabbix/. > > > > I have been digging in the mailinglist archives to find out why > > > > Alex > > > > was using /usr/lib/zabbix/ and thus I was 'deep' into the > > > > modules- > > > > dirs > > > > saga that I considered it 'common knowledge' at that point in > > > > time > > > > where I committed this change. But of course, it is no common > > > > knowledge > > > > for you guys :-) > > > > I will try to pay more attention to such things in the future. > > > > > > > > Regards > > > > Robin > > > > > > > > Adolf Belka schreef op vr 09-04-2021 om 21:36 [+0200]: > > > > > Hi Robin, > > > > > > > > > > The patches seem fine to me, although again my lack of zabbix > > > > > knowledge means I can't comment on specifics easily. > > > > > > > > > > Only minor general point I had was that the commit message > > > > > might > > > > > have > > > > > more clearly specified that the modules-dir is > > > > > /usr/lib/zabbix. I > > > > > had > > > > > to read through the whole patch to come to that conclusion. > > > > > > > > > > Overall these look good patches for your first input. > > > > > > > > > > Regards, > > > > > > > > > > Adolf > > > > > > > > > > On 07/04/2021 22:44, Robin Roevens wrote: > > > > > > - Add agent modules-dir to backup > > > > > > - Remove original, not used agent modules dir from rootfile > > > > > > - Delete agent modules dir only when empty on uninstall > > > > > > thus > > > > > > keeping > > > > > > possible user deployed custom module files but removing > > > > > > it > > > > > > if > > > > > > unused. > > > > > > > > > > > > Signed-off-by: Robin Roevens <robin.roevens@disroot.org> > > > > > > --- > > > > > > config/backup/includes/zabbix_agentd | 3 ++- > > > > > > config/rootfiles/packages/zabbix_agentd | 4 ++-- > > > > > > src/paks/zabbix_agentd/install.sh | 2 ++ > > > > > > src/paks/zabbix_agentd/uninstall.sh | 5 +++++ > > > > > > src/paks/zabbix_agentd/update.sh | 1 + > > > > > > 5 files changed, 12 insertions(+), 3 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..a938f2605 100644 > > > > > > --- a/config/rootfiles/packages/zabbix_agentd > > > > > > +++ b/config/rootfiles/packages/zabbix_agentd > > > > > > @@ -8,8 +8,8 @@ etc/zabbix_agentd/zabbix_agentd.d > > > > > > > > > > > > etc/zabbix_agentd/zabbix_agentd.d/userparameter_pakfire.con > > > > > > f > > > > > > usr/bin/zabbix_get > > > > > > usr/bin/zabbix_sender > > > > > > -usr/lib/modules > > > > > > -usr/lib/zabbix > > > > > > +#usr/lib/modules > > > > > > +#usr/lib/zabbix > > > > > > usr/sbin/zabbix_agentd > > > > > > #usr/share/man/man1/zabbix_get.1 > > > > > > #usr/share/man/man1/zabbix_sender.1 > > > > > > diff --git a/src/paks/zabbix_agentd/install.sh > > > > > > b/src/paks/zabbix_agentd/install.sh > > > > > > index e1450a1d8..b98230ea1 100644 > > > > > > --- a/src/paks/zabbix_agentd/install.sh > > > > > > +++ b/src/paks/zabbix_agentd/install.sh > > > > > > @@ -41,6 +41,8 @@ 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 > > > > > > +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/uninstall.sh > > > > > > b/src/paks/zabbix_agentd/uninstall.sh > > > > > > index edff3b818..b771d1f63 100644 > > > > > > --- a/src/paks/zabbix_agentd/uninstall.sh > > > > > > +++ b/src/paks/zabbix_agentd/uninstall.sh > > > > > > @@ -26,5 +26,10 @@ stop_service ${NAME} > > > > > > make_backup ${NAME} > > > > > > remove_files > > > > > > > > > > > > +# Remove agent modules dir if empty > > > > > > +if [ -z "$(ls -A /usr/lib/zabbix/)" ]; then > > > > > > + rmdir /usr/lib/zabbix > > > > > > +fi > > > > > > + > > > > > > # Remove init-scripts and symlinks > > > > > > rm -rfv /etc/rc.d/rc*.d/*zabbix_agentd > > > > > > 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 > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Dit bericht is gescanned op virussen en andere gevaarlijke > > > > inhoud door MailScanner en lijkt schoon te zijn. > > > > > > > > > > > > > > > > -- > > Dit bericht is gescanned op virussen en andere gevaarlijke > > inhoud door MailScanner en lijkt schoon te zijn. > > > >
Hello, In that case ignore what I have said. It probably is sufficient if we create this directory and that is it. If we add our own files, we will have to revisit then. Thanks for clearing this up for me. -Michael > On 12 Apr 2021, at 12:38, Robin Roevens <robin.roevens@disroot.org> wrote: > > Hi > > That directory is purely meant for user-modules and by default is empty > as nor we, nor Zabbix ship user-modules with the agent. And I don't see > that changing in the near future. So currently indeed only user-files > will be located there. > > Robin > > Michael Tremer schreef op ma 12-04-2021 om 11:52 [+0100]: >> Hello, >> >> I agree, /etc isn’t exactly the best place for it, but it comes with >> a couple of benefits: >> >> * We will include those files in the backup (or at least should be >> doing so) >> >> * We have control over /usr/lib/zabbix and can do whatever we need >> there (I was assuming that there are some system files in there - if >> that is wrong and there is nothing in this directory apart from user >> files, we can leave it as /usr/lib/zabbix) >> >> -Michael >> >>> On 12 Apr 2021, at 11:50, Robin Roevens <robin.roevens@disroot.org> >>> wrote: >>> >>> (forgot to reply to all :-)) >>> >>> Hi >>> >>> In theory, I think I could move the modules dir from current >>> /usr/lib/zabbix to /etc/zabbix_agentd/modules for example. >>> >>> However modules are not planin text config files but rather binary >>> (possibly user-created and compiled) libraries that plug into the >>> agent >>> to extend it's functionality. So I assume a user will probably have >>> the >>> source code of the binary library some place else and could >>> probably >>> easily re-deploy the compiled modules after the backup is restored >>> in a >>> recovery situation. But I figured, as it is in a way a >>> configuration of >>> the agent instance, it should also be backed up, not requiring >>> users to >>> re-deploy those after a recovery. >>> But moving binary files into /etc/... feels a bit awkward.. but >>> technically it could be done. >>> >>> Robin >>> >>> Michael Tremer schreef op ma 12-04-2021 om 11:26 [+0100]: >>>> Hello, >>>> >>>> So, this is slightly more complicated. >>>> >>>> The usual way how we do things is to back up any kind of >>>> configuration, uninstall everything, install the new package and >>>> then >>>> restore the configuration. >>>> >>>> Having custom files in a system directory is probably going to >>>> break >>>> this. >>>> >>>> Is there any way to have custom scripts in /etc/zabbix/… or >>>> something >>>> similar? >>>> >>>> -Michael >>>> >>>>> On 10 Apr 2021, at 22:13, Robin Roevens >>>>> <robin.roevens@disroot.org> >>>>> wrote: >>>>> >>>>> Hi Adolf >>>>> >>>>> Indeed, I should have explicitly mentioned the modules-dir; the >>>>> original /usr/lib/modules which was removed from the rootfile >>>>> and >>>>> the >>>>> custom one, introduced by Alex, but not backed up until now: >>>>> /usr/lib/zabbix/. >>>>> I have been digging in the mailinglist archives to find out why >>>>> Alex >>>>> was using /usr/lib/zabbix/ and thus I was 'deep' into the >>>>> modules- >>>>> dirs >>>>> saga that I considered it 'common knowledge' at that point in >>>>> time >>>>> where I committed this change. But of course, it is no common >>>>> knowledge >>>>> for you guys :-) >>>>> I will try to pay more attention to such things in the future. >>>>> >>>>> Regards >>>>> Robin >>>>> >>>>> Adolf Belka schreef op vr 09-04-2021 om 21:36 [+0200]: >>>>>> Hi Robin, >>>>>> >>>>>> The patches seem fine to me, although again my lack of zabbix >>>>>> knowledge means I can't comment on specifics easily. >>>>>> >>>>>> Only minor general point I had was that the commit message >>>>>> might >>>>>> have >>>>>> more clearly specified that the modules-dir is >>>>>> /usr/lib/zabbix. I >>>>>> had >>>>>> to read through the whole patch to come to that conclusion. >>>>>> >>>>>> Overall these look good patches for your first input. >>>>>> >>>>>> Regards, >>>>>> >>>>>> Adolf >>>>>> >>>>>> On 07/04/2021 22:44, Robin Roevens wrote: >>>>>>> - Add agent modules-dir to backup >>>>>>> - Remove original, not used agent modules dir from rootfile >>>>>>> - Delete agent modules dir only when empty on uninstall >>>>>>> thus >>>>>>> keeping >>>>>>> possible user deployed custom module files but removing >>>>>>> it >>>>>>> if >>>>>>> unused. >>>>>>> >>>>>>> Signed-off-by: Robin Roevens <robin.roevens@disroot.org> >>>>>>> --- >>>>>>> config/backup/includes/zabbix_agentd | 3 ++- >>>>>>> config/rootfiles/packages/zabbix_agentd | 4 ++-- >>>>>>> src/paks/zabbix_agentd/install.sh | 2 ++ >>>>>>> src/paks/zabbix_agentd/uninstall.sh | 5 +++++ >>>>>>> src/paks/zabbix_agentd/update.sh | 1 + >>>>>>> 5 files changed, 12 insertions(+), 3 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..a938f2605 100644 >>>>>>> --- a/config/rootfiles/packages/zabbix_agentd >>>>>>> +++ b/config/rootfiles/packages/zabbix_agentd >>>>>>> @@ -8,8 +8,8 @@ etc/zabbix_agentd/zabbix_agentd.d >>>>>>> >>>>>>> etc/zabbix_agentd/zabbix_agentd.d/userparameter_pakfire.con >>>>>>> f >>>>>>> usr/bin/zabbix_get >>>>>>> usr/bin/zabbix_sender >>>>>>> -usr/lib/modules >>>>>>> -usr/lib/zabbix >>>>>>> +#usr/lib/modules >>>>>>> +#usr/lib/zabbix >>>>>>> usr/sbin/zabbix_agentd >>>>>>> #usr/share/man/man1/zabbix_get.1 >>>>>>> #usr/share/man/man1/zabbix_sender.1 >>>>>>> diff --git a/src/paks/zabbix_agentd/install.sh >>>>>>> b/src/paks/zabbix_agentd/install.sh >>>>>>> index e1450a1d8..b98230ea1 100644 >>>>>>> --- a/src/paks/zabbix_agentd/install.sh >>>>>>> +++ b/src/paks/zabbix_agentd/install.sh >>>>>>> @@ -41,6 +41,8 @@ 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 >>>>>>> +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/uninstall.sh >>>>>>> b/src/paks/zabbix_agentd/uninstall.sh >>>>>>> index edff3b818..b771d1f63 100644 >>>>>>> --- a/src/paks/zabbix_agentd/uninstall.sh >>>>>>> +++ b/src/paks/zabbix_agentd/uninstall.sh >>>>>>> @@ -26,5 +26,10 @@ stop_service ${NAME} >>>>>>> make_backup ${NAME} >>>>>>> remove_files >>>>>>> >>>>>>> +# Remove agent modules dir if empty >>>>>>> +if [ -z "$(ls -A /usr/lib/zabbix/)" ]; then >>>>>>> + rmdir /usr/lib/zabbix >>>>>>> +fi >>>>>>> + >>>>>>> # Remove init-scripts and symlinks >>>>>>> rm -rfv /etc/rc.d/rc*.d/*zabbix_agentd >>>>>>> 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 >>>>>>> >>>>>> >>>>> >>>>> >>>>> -- >>>>> Dit bericht is gescanned op virussen en andere gevaarlijke >>>>> inhoud door MailScanner en lijkt schoon te zijn. >>>>> >>>> >>>> >>> >>> >>> -- >>> Dit bericht is gescanned op virussen en andere gevaarlijke >>> inhoud door MailScanner en lijkt schoon te zijn. >>> >> >> > > > -- > Dit bericht is gescanned op virussen en andere gevaarlijke > inhoud door MailScanner en lijkt schoon te zijn. >
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..a938f2605 100644 --- a/config/rootfiles/packages/zabbix_agentd +++ b/config/rootfiles/packages/zabbix_agentd @@ -8,8 +8,8 @@ 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/zabbix +#usr/lib/modules +#usr/lib/zabbix usr/sbin/zabbix_agentd #usr/share/man/man1/zabbix_get.1 #usr/share/man/man1/zabbix_sender.1 diff --git a/src/paks/zabbix_agentd/install.sh b/src/paks/zabbix_agentd/install.sh index e1450a1d8..b98230ea1 100644 --- a/src/paks/zabbix_agentd/install.sh +++ b/src/paks/zabbix_agentd/install.sh @@ -41,6 +41,8 @@ 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 +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/uninstall.sh b/src/paks/zabbix_agentd/uninstall.sh index edff3b818..b771d1f63 100644 --- a/src/paks/zabbix_agentd/uninstall.sh +++ b/src/paks/zabbix_agentd/uninstall.sh @@ -26,5 +26,10 @@ stop_service ${NAME} make_backup ${NAME} remove_files +# Remove agent modules dir if empty +if [ -z "$(ls -A /usr/lib/zabbix/)" ]; then + rmdir /usr/lib/zabbix +fi + # Remove init-scripts and symlinks rm -rfv /etc/rc.d/rc*.d/*zabbix_agentd 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