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: Tue, 02 Aug 2022 15:17:50 +0000 Message-ID: In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7456339671248330733==" List-Id: --===============7456339671248330733== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hello Jon, apologies for the belated reply. The second version of your patch looks quite good to me, I just reviewed it a= nd will merge it soon. :-) Thanks, and best regards, Peter M=C3=BCller P.S.: On the occasion of yesterdays' monthly video conference, I just wanted = to relay that we (=3D all the other folks usually hanging around there) would be= thrilled to have you as well, should you have time and motivation to join. No pressure= or any obligations though. :-) > Peter - I did a make build with the changes but now I am confused. >=20 > My changes look like this (V1 to V2) > # Stop collectd Sevice > /etc/init.d/collectd stop > =20 > # 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 > +rm -rvf /var/log/rrd/collectd/localhost/processes-mysqld \ > + /var/log/rrd/collectd/localhost/processes-snort \ > + /var/log/rrd/collectd/localhost/processes-rtorrent \ > + /var/log/rrd/collectd/localhost/processes-asterisk \ > + /var/log/rrd/collectd/localhost/processes-java \ > + /var/log/rrd/collectd/localhost/processes-spamd > # > # Start collectd > /etc/init.d/collectd start >=20 >=20 > Instead of this ("next" to V2) >=20 > +# Stop collectd Sevice > +/etc/init.d/collectd stop > + > +# Cleanup old collectd statistics... > +rm -rf /var/log/rrd/collectd/localhost/processes-mysqld \ > /var/log/rrd/collectd/localhost/processes-snort \ > /var/log/rrd/collectd/localhost/processes-rtorrent \ > /var/log/rrd/collectd/localhost/processes-asterisk \ > /var/log/rrd/collectd/localhost/processes-java \ > /var/log/rrd/collectd/localhost/processes-spamd > +# > +# Start collectd > +/etc/init.d/collectd start > + >=20 > What should they look like? Do I start from scratch? >=20 >=20 > Jon >=20 >=20 >=20 >> On Jul 30, 2022, at 2:33 AM, Peter M=C3=BCller wrote: >> >> Hello Jon, >> >> thank you for submitting this. Regarding the "rm" calls, I have two commen= ts: >> >> (a) For transparency reasons, I have shifted to always adding "-v" argumen= t 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 = clear >> 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 >>> Signed-off-by: Jon Murphy >>> --- >>> config/rootfiles/core/170/update.sh | 14 ++++++++++++++ >>> 1 file changed, 14 insertions(+) >>> diff --git a/config/rootfiles/core/170/update.sh b/config/rootfiles/core/= 170/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 >>> +# 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 >=20 >=20 --===============7456339671248330733==--