From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adolf Belka To: development@lists.ipfire.org Subject: Re: [PATCH 2/4] [V2] zabbix_agentd: Fix agent modules directory Date: Fri, 09 Apr 2021 21:36:39 +0200 Message-ID: In-Reply-To: <20210407204455.450-3-robin.roevens@disroot.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2751076785184932201==" List-Id: --===============2751076785184932201== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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 cl= early specified that the modules-dir is /usr/lib/zabbix. I had to read throug= h 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 > --- > 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/pac= kages/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/ins= tall.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 > =20 > restore_backup ${NAME} > start_service --background ${NAME} > diff --git a/src/paks/zabbix_agentd/uninstall.sh b/src/paks/zabbix_agentd/u= ninstall.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 > =20 > +# 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/upda= te.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 > =20 --===============2751076785184932201==--