From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter =?utf-8?q?M=C3=BCller?= To: development@lists.ipfire.org Subject: Re: [PATCH] update.sh: clean out old collectd process statistics Date: Sat, 30 Jul 2022 07:33:56 +0000 Message-ID: <0ea84e2f-b296-7fe1-e753-51919eca57cf@ipfire.org> In-Reply-To: <20220730022802.3653144-1-jon.murphy@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6184288674648682434==" List-Id: --===============6184288674648682434== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello Jon, thank you for submitting this. Regarding the "rm" calls, I have two comments: (a) For transparency reasons, I have shifted to always adding "-v" argument to rm calls during a Core Update, so deleted files are logged. In case of troubleshooting, this should make (our) lives a bit easier since it is c= lear what has been deleted. (b) This could have been one single rm call, i.e.: rm -rvf \ file A \ file B \ ... \ file N The update.sh script for Core Update 170 should feature such a (lengthy) rm call, if I am not mistaken. Thanks, and best regards, Peter M=C3=BCller > - processes-mysqld > - processes-snort > - processes-rtorrent > - processes-asterisk > - processes-java > - processes-spamd >=20 > Signed-off-by: Jon Murphy > --- > config/rootfiles/core/170/update.sh | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) >=20 > diff --git a/config/rootfiles/core/170/update.sh b/config/rootfiles/core/17= 0/update.sh > index cbac8572e..ec6c5ad09 100644 > --- a/config/rootfiles/core/170/update.sh > +++ b/config/rootfiles/core/170/update.sh > @@ -170,6 +170,20 @@ sed -i /etc/collectd.conf \ > -e "/LoadPlugin entropy/d" > /etc/init.d/collectd restart > =20 > +# Stop collectd Sevice > +/etc/init.d/collectd stop > + > +# Cleanup old collectd statistics... > +rm -rf /var/log/rrd/collectd/localhost/processes-mysqld > +rm -rf /var/log/rrd/collectd/localhost/processes-snort > +rm -rf /var/log/rrd/collectd/localhost/processes-rtorrent > +rm -rf /var/log/rrd/collectd/localhost/processes-asterisk > +rm -rf /var/log/rrd/collectd/localhost/processes-java > +rm -rf /var/log/rrd/collectd/localhost/processes-spamd > +# > +# Start collectd > +/etc/init.d/collectd start > + > # Start services > /etc/init.d/rc.d/unbound start > /etc/init.d/rc.d/suricata start --===============6184288674648682434==--