Message ID | 035d75cb-6ca2-e5f4-d9f8-c78906776c12@link38.eu |
---|---|
State | Superseded |
Headers |
Return-Path: <development-bounces@lists.ipfire.org> Received: from mail01.ipfire.org (mail01.ipfire.org [IPv6:2001:470:7183:25::1]) by web02.i.ipfire.org (Postfix) with ESMTP id 563F660B61 for <patchwork@web02.i.ipfire.org>; Thu, 26 Apr 2018 17:17:24 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id A8A25110933B; Thu, 26 Apr 2018 16:17:23 +0100 (BST) Authentication-Results: dkim=pass header.d=link38.eu; dmarc=pass (policy=none) header.from=link38.eu; spf=pass smtp.mailfrom=peter.mueller@link38.eu Received: from mx-nbg.link38.eu (mx-nbg.link38.eu [IPv6:2a03:4000:6:432c:1f9e:48:ac3:199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx-nbg.link38.eu", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 5FEDC108B89E for <development@lists.ipfire.org>; Thu, 26 Apr 2018 16:17:21 +0100 (BST) ARC-Authentication-Results: i=1; mx-nbg.link38.eu DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=link38.eu; s=201803; t=1524755840; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sTbg3kDL+i2el4ctbT1t1mUEa9qYgQ1+NAI5UzuNjNQ=; b=QVo+DdSr4NvAyLO0L08Mi9pr1KQoYhkzG3EYi74jZYgQkSlXkLSa09gcvuEtdObn2VAax9 LuZFM4i4SNqsk9P+eawGjkEsiWV7wEDrBjqo2pYutsZIG+grRmAVzmyImJTRTgnODO8A1i JM0zomVwVmpexs4QgosBSsnubeZYkp+e+IyLCziv3D5SATtMGlOBANBYefUbENdN/SK51v RtnVFd2tvdh4KLBGjOp//PUGc89kR2i8LlDjlD8JuVzKIAtKjwvGOBbqLtGxk44djtw9hY pCB+eMkrwFAvNwmNZ0xTL6esoAyU9Ze6KWMtLvqgDyM5g0aRn8lNEEAsRE37DQ== ARC-Seal: i=1; s=201803; d=link38.eu; t=1524755840; a=rsa-sha256; cv=none; b=3OD/pr5U1F7+Z7H2+K92ILyf5jBZPwOPDxFkmqxcUllcgjBGVF7bRUbzwWcnvByjxn+NVWxPqLj0oZy1XOZ7Jo2JUqZeXeKyol9k1VqQDsKIKcyXNacYJyyimJt5NGvTWL/+zPPbjILqlRgzkpSVifDtJdIl586DmUOdfF7+0+sSjZJBH8YNBxaNmNKFSYwg91spD1s4XxhOalfmGS70+rrKJg9Y5A5Y75X/dIHgIc2xks20XxQlKaGTNriZ61+shL7ZSFaIDCwvGmJo9JeFWep+BzGekvuTgruh9GDCX6fWnNYAgvowokbcstqbHbNVntiXhTyCE0iWaH0jczmpDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=link38.eu; s=201803; t=1524755840; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sTbg3kDL+i2el4ctbT1t1mUEa9qYgQ1+NAI5UzuNjNQ=; b=DsA/EPV30w44kwJhb670Eap56JxNDUEH023HLhuzQ5cLg70jQI9MJuPaXxeeueV0/xAbrL ibbSngwVkP+ebukyc1OItTS82Yis2+vR1lzR7LAMclFX/ovUnQLBwLnwzIgHcL2RNip76j pn6EE7wQ7mV0/gR+8K/esuHCF6GW/PfI18A0jBtSQu7QZYOQq/y33dFgsHNlm12PoPmdoV +n68Iy1sqzksIHUYcc4iuNjc7d6nKCy001cldflZnchCf4WqQFOzkjuInpp3drmb8mn8Vc Aw3xnV8YvlpvdeLqHhAkZVnh3fh3mXB8lwJsjMyo3P0+tDZx+XIEyGVXAcUqxw== Subject: [PATCH v2] remove forgotten Nagios files, if any To: Michael Tremer <michael.tremer@ipfire.org> References: <9d8304a8-aeaa-9e6e-45ef-548c33b86989@link38.eu> <1524562503.1637848.273.camel@ipfire.org> <e98682ee-b3d4-4b20-9758-d12529898327@link38.eu> <1524581883.2274586.39.camel@ipfire.org> From: =?utf-8?q?Peter_M=C3=BCller?= <peter.mueller@link38.eu> Message-ID: <035d75cb-6ca2-e5f4-d9f8-c78906776c12@link38.eu> Date: Thu, 26 Apr 2018 17:17:19 +0200 MIME-Version: 1.0 In-Reply-To: <1524581883.2274586.39.camel@ipfire.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spamd-Result: default: False [-10.52 / 11.00]; RCPT_COUNT_TWO(0.00)[2]; ARC_ALLOW(-1.00)[i=1]; RCVD_IN_DNSWL_MED(-2.00)[9.9.1.0.3.c.a.0.8.4.0.0.e.9.f.1.c.2.3.4.6.0.0.0.0.0.0.4.3.0.a.2.list.dnswl.org : 127.0.6.2]; RCVD_COUNT_ZERO(0.00)[0]; FROM_HAS_DN(0.00)[]; MX_GOOD(-0.01)[cached: mx-nbg.link38.eu]; IP_SCORE(-3.76)[ip: (-9.84), ipnet: 2a03:4000::/32(-4.92), asn: 197540(-3.95), country: DE(-0.09)]; BAYES_HAM(-3.00)[100.00%]; DKIM_TRACE(0.00)[link38.eu:+]; TO_DN_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a03:4000:6:432c:1f9e:48:ac3:199]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DMARC_POLICY_ALLOW(-0.25)[link38.eu,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_GOOD(-0.10)[text/plain]; R_DKIM_ALLOW(-0.20)[link38.eu]; ASN(0.00)[asn:197540, ipnet:2a03:4000::/32, country:DE]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Status: No, score=-10.52 X-Rspamd-Server: mail01.i.ipfire.org Cc: "IPFire: Development-List" <development@lists.ipfire.org> X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 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: <https://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 |
[v2] remove forgotten Nagios files, if any
|
|
Commit Message
Peter Müller
April 27, 2018, 1:17 a.m. UTC
When we decided to drop Nagios, some files were not removed on the
installations. Since the package does not exist anymore, "pakfire remove
nagios" does not work so we need to clean them up manually in case they exist.
The second version of this patch makes sure Apache is restarted afterwards,
and includes some forgotten files [sic] as well as it is now applying for
Core Update 121.
Signed-off-by: Peter Müller <peter.mueller@link38.eu>
---
config/rootfiles/core/121/update.sh | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
Comments
Hey, On Thu, 2018-04-26 at 17:17 +0200, Peter Müller wrote: > When we decided to drop Nagios, some files were not removed on the > installations. Since the package does not exist anymore, "pakfire remove > nagios" does not work so we need to clean them up manually in case they exist. > > The second version of this patch makes sure Apache is restarted afterwards, > and includes some forgotten files [sic] as well as it is now applying for > Core Update 121. > > Signed-off-by: Peter Müller <peter.mueller@link38.eu> > --- > config/rootfiles/core/121/update.sh | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > > diff --git a/config/rootfiles/core/121/update.sh > b/config/rootfiles/core/121/update.sh > index 9986316e9..422f8f20f 100644 > --- a/config/rootfiles/core/121/update.sh > +++ b/config/rootfiles/core/121/update.sh > @@ -17,14 +17,14 @@ > # along with IPFire; if not, write to the Free Software # > # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # > # # > -# Copyright (C) 2017 IPFire-Team <info@ipfire.org>. # > +# Copyright (C) 2018 IPFire-Team <info@ipfire.org>. # > # # > ############################################################################ > # > . /opt/pakfire/lib/functions.sh > /usr/local/bin/backupctrl exclude >/dev/null 2>&1 > > -core=120 > +core=121 > > # Remove old core updates from pakfire cache to save space... > for (( i=1; i<=$core; i++ )); do > @@ -42,7 +42,21 @@ ldconfig > # Update Language cache > /usr/local/bin/update-lang-cache > > +# Remove forgotten Nagios files, if any... > +test -f /etc/rc.d/init.d/nagios && rm -f /etc/rc.d/init.d/nagios > +test -f /usr/bin/nagios && rm -f /usr/bin/nagios > +test -f /etc/rc.d/rc6.d/K33nagios && rm -f /etc/rc.d/rc6.d/K33nagios > +test -f /etc/rc.d/rc3.d/off/S67nagios && rm -f /etc/rc.d/rc3.d/off/S67nagios > +test -f /etc/rc.d/rc0.d/K33nagios && rm -f /etc/rc.d/rc0.d/K33nagios > +test -f /etc/httpd/conf/conf.d/nagios.conf && rm -f > /etc/httpd/conf/conf.d/nagios.conf > +test -f /etc/nagios/nagios.cfg && rm -f /etc/nagios/nagios.cfg > +test -f /usr/bin/p1.pl && rm -f /usr/bin/p1.pl > +test -f /usr/bin/nagiostats && rm -f /usr/bin/nagiostats > +test -d /usr/share/nagios/ && rm -rf /usr/share/nagios/ > +test -d /var/nagios/ && rm -rf /var/nagios/ There is no need to test if the files or directories exist before deleting with rm -f. rm won't do anything if the files don't exist. You can also just call rm once and add all files in one go. That would be tidier and if you would then sort the arguments alphabetically work well when someone extends it. Patches won't conflict then unless the same lines are being changed. > + > # Start services > +/etc/init.d/apache restart > > # This update needs a reboot... > touch /var/run/need_reboot
Hello Michael, thanks for the quick feedback. > Hey, > > On Thu, 2018-04-26 at 17:17 +0200, Peter Müller wrote: >> When we decided to drop Nagios, some files were not removed on the >> installations. Since the package does not exist anymore, "pakfire remove >> nagios" does not work so we need to clean them up manually in case they exist. >> >> The second version of this patch makes sure Apache is restarted afterwards, >> and includes some forgotten files [sic] as well as it is now applying for >> Core Update 121. >> >> Signed-off-by: Peter Müller <peter.mueller@link38.eu> >> --- >> config/rootfiles/core/121/update.sh | 18 ++++++++++++++++-- >> 1 file changed, 16 insertions(+), 2 deletions(-) >> >> diff --git a/config/rootfiles/core/121/update.sh >> b/config/rootfiles/core/121/update.sh >> index 9986316e9..422f8f20f 100644 >> --- a/config/rootfiles/core/121/update.sh >> +++ b/config/rootfiles/core/121/update.sh >> @@ -17,14 +17,14 @@ >> # along with IPFire; if not, write to the Free Software # >> # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # >> # # >> -# Copyright (C) 2017 IPFire-Team <info@ipfire.org>. # >> +# Copyright (C) 2018 IPFire-Team <info@ipfire.org>. # >> # # >> ############################################################################ >> # >> . /opt/pakfire/lib/functions.sh >> /usr/local/bin/backupctrl exclude >/dev/null 2>&1 >> >> -core=120 >> +core=121 >> >> # Remove old core updates from pakfire cache to save space... >> for (( i=1; i<=$core; i++ )); do >> @@ -42,7 +42,21 @@ ldconfig >> # Update Language cache >> /usr/local/bin/update-lang-cache >> >> +# Remove forgotten Nagios files, if any... >> +test -f /etc/rc.d/init.d/nagios && rm -f /etc/rc.d/init.d/nagios >> +test -f /usr/bin/nagios && rm -f /usr/bin/nagios >> +test -f /etc/rc.d/rc6.d/K33nagios && rm -f /etc/rc.d/rc6.d/K33nagios >> +test -f /etc/rc.d/rc3.d/off/S67nagios && rm -f /etc/rc.d/rc3.d/off/S67nagios >> +test -f /etc/rc.d/rc0.d/K33nagios && rm -f /etc/rc.d/rc0.d/K33nagios >> +test -f /etc/httpd/conf/conf.d/nagios.conf && rm -f >> /etc/httpd/conf/conf.d/nagios.conf >> +test -f /etc/nagios/nagios.cfg && rm -f /etc/nagios/nagios.cfg >> +test -f /usr/bin/p1.pl && rm -f /usr/bin/p1.pl >> +test -f /usr/bin/nagiostats && rm -f /usr/bin/nagiostats >> +test -d /usr/share/nagios/ && rm -rf /usr/share/nagios/ >> +test -d /var/nagios/ && rm -rf /var/nagios/ > > There is no need to test if the files or directories exist before deleting with > rm -f. rm won't do anything if the files don't exist. Well, we can never be sure... :-) Will change that in the 3rd version. > > You can also just call rm once and add all files in one go. That would be tidier > and if you would then sort the arguments alphabetically work well when someone > extends it. Patches won't conflict then unless the same lines are being changed. I am afraid I did not get it. Do you mean something like rm -f [file1] [file2] [file3] ... or for i in (file1, file2, file3, ...); do rm -f $i; done; ? Thanks, Peter Müller > >> + >> # Start services >> +/etc/init.d/apache restart >> >> # This update needs a reboot... >> touch /var/run/need_reboot
On Thu, 2018-04-26 at 19:25 +0200, Peter Müller wrote: > Hello Michael, > > thanks for the quick feedback. > > Hey, > > > > On Thu, 2018-04-26 at 17:17 +0200, Peter Müller wrote: > > > When we decided to drop Nagios, some files were not removed on the > > > installations. Since the package does not exist anymore, "pakfire remove > > > nagios" does not work so we need to clean them up manually in case they > > > exist. > > > > > > The second version of this patch makes sure Apache is restarted > > > afterwards, > > > and includes some forgotten files [sic] as well as it is now applying for > > > Core Update 121. > > > > > > Signed-off-by: Peter Müller <peter.mueller@link38.eu> > > > --- > > > config/rootfiles/core/121/update.sh | 18 ++++++++++++++++-- > > > 1 file changed, 16 insertions(+), 2 deletions(-) > > > > > > diff --git a/config/rootfiles/core/121/update.sh > > > b/config/rootfiles/core/121/update.sh > > > index 9986316e9..422f8f20f 100644 > > > --- a/config/rootfiles/core/121/update.sh > > > +++ b/config/rootfiles/core/121/update.sh > > > @@ -17,14 +17,14 @@ > > > # along with IPFire; if not, write to the Free > > > Software # > > > # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 > > > USA # > > > # > > > # > > > -# Copyright (C) 2017 IPFire-Team <info@ipfire.org>. > > > # > > > +# Copyright (C) 2018 IPFire-Team <info@ipfire.org>. > > > # > > > # > > > # > > > ######################################################################### > > > ### > > > # > > > . /opt/pakfire/lib/functions.sh > > > /usr/local/bin/backupctrl exclude >/dev/null 2>&1 > > > > > > -core=120 > > > +core=121 > > > > > > # Remove old core updates from pakfire cache to save space... > > > for (( i=1; i<=$core; i++ )); do > > > @@ -42,7 +42,21 @@ ldconfig > > > # Update Language cache > > > /usr/local/bin/update-lang-cache > > > > > > +# Remove forgotten Nagios files, if any... > > > +test -f /etc/rc.d/init.d/nagios && rm -f /etc/rc.d/init.d/nagios > > > +test -f /usr/bin/nagios && rm -f /usr/bin/nagios > > > +test -f /etc/rc.d/rc6.d/K33nagios && rm -f /etc/rc.d/rc6.d/K33nagios > > > +test -f /etc/rc.d/rc3.d/off/S67nagios && rm -f > > > /etc/rc.d/rc3.d/off/S67nagios > > > +test -f /etc/rc.d/rc0.d/K33nagios && rm -f /etc/rc.d/rc0.d/K33nagios > > > +test -f /etc/httpd/conf/conf.d/nagios.conf && rm -f > > > /etc/httpd/conf/conf.d/nagios.conf > > > +test -f /etc/nagios/nagios.cfg && rm -f /etc/nagios/nagios.cfg > > > +test -f /usr/bin/p1.pl && rm -f /usr/bin/p1.pl > > > +test -f /usr/bin/nagiostats && rm -f /usr/bin/nagiostats > > > +test -d /usr/share/nagios/ && rm -rf /usr/share/nagios/ > > > +test -d /var/nagios/ && rm -rf /var/nagios/ > > > > There is no need to test if the files or directories exist before deleting > > with > > rm -f. rm won't do anything if the files don't exist. > > Well, we can never be sure... :-) Will change that in the 3rd version. > > > > You can also just call rm once and add all files in one go. That would be > > tidier > > and if you would then sort the arguments alphabetically work well when > > someone > > extends it. Patches won't conflict then unless the same lines are being > > changed. > > I am afraid I did not get it. Do you mean something like > > rm -f [file1] [file2] [file3] ... > > or > > for i in (file1, file2, file3, ...); do > rm -f $i; > done; Like this: https://git.ipfire.org/?p=ipfire-2.x.git;a=blob;f=config/rootfiles/oldcore/119/update.sh;h=8ada474553cf3e87ea2367e560532816ea9ecdc9;hb=HEAD#l37 Don't forget to add the -r if you need it. > > ? > > Thanks, > Peter Müller > > > > > + > > > # Start services > > > +/etc/init.d/apache restart > > > > > > # This update needs a reboot... > > > touch /var/run/need_reboot
diff --git a/config/rootfiles/core/121/update.sh b/config/rootfiles/core/121/update.sh index 9986316e9..422f8f20f 100644 --- a/config/rootfiles/core/121/update.sh +++ b/config/rootfiles/core/121/update.sh @@ -17,14 +17,14 @@ # along with IPFire; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # -# Copyright (C) 2017 IPFire-Team <info@ipfire.org>. # +# Copyright (C) 2018 IPFire-Team <info@ipfire.org>. # # # ############################################################################ # . /opt/pakfire/lib/functions.sh /usr/local/bin/backupctrl exclude >/dev/null 2>&1 -core=120 +core=121 # Remove old core updates from pakfire cache to save space... for (( i=1; i<=$core; i++ )); do @@ -42,7 +42,21 @@ ldconfig # Update Language cache /usr/local/bin/update-lang-cache +# Remove forgotten Nagios files, if any... +test -f /etc/rc.d/init.d/nagios && rm -f /etc/rc.d/init.d/nagios +test -f /usr/bin/nagios && rm -f /usr/bin/nagios +test -f /etc/rc.d/rc6.d/K33nagios && rm -f /etc/rc.d/rc6.d/K33nagios +test -f /etc/rc.d/rc3.d/off/S67nagios && rm -f /etc/rc.d/rc3.d/off/S67nagios +test -f /etc/rc.d/rc0.d/K33nagios && rm -f /etc/rc.d/rc0.d/K33nagios +test -f /etc/httpd/conf/conf.d/nagios.conf && rm -f /etc/httpd/conf/conf.d/nagios.conf +test -f /etc/nagios/nagios.cfg && rm -f /etc/nagios/nagios.cfg +test -f /usr/bin/p1.pl && rm -f /usr/bin/p1.pl +test -f /usr/bin/nagiostats && rm -f /usr/bin/nagiostats +test -d /usr/share/nagios/ && rm -rf /usr/share/nagios/ +test -d /var/nagios/ && rm -rf /var/nagios/ + # Start services +/etc/init.d/apache restart # This update needs a reboot... touch /var/run/need_reboot