From: Arne Fitzenreiter Date: Sun, 26 Jan 2025 10:41:54 +0000 (+0100) Subject: core192: fix some collectd convertion issues X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8d0df657b53e9f9930827278bf22a3892e47e456;p=people%2Fms%2Fipfire-2.x.git core192: fix some collectd convertion issues Signed-off-by: Arne Fitzenreiter --- diff --git a/config/backup/backup.pl b/config/backup/backup.pl index 959804b59..07b809441 100644 --- a/config/backup/backup.pl +++ b/config/backup/backup.pl @@ -2,7 +2,7 @@ ############################################################################### # # # IPFire.org - A linux based firewall # -# Copyright (C) 2007-2024 IPFire Team # +# Copyright (C) 2007-2025 IPFire Team # # # # This program is free software: you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # @@ -75,6 +75,10 @@ make_backup() { restore_backup() { local filename="${1}" + # stop collectd to remove the rrd ramdisk for restore and convert + # the rrd's + /etc/rc.d/init.d/collectd stop + # remove all openvpn certs to prevent old unusable # certificates being left in directory after a restore rm -f /var/ipfire/ovpn/certs/* @@ -264,9 +268,13 @@ restore_backup() { # be empty after the migration has been carried out. /var/ipfire/collectd-migrate-4-to-5.pl --indir /var/log/rrd/ > /tmp/rrd-migrate.sh sh /tmp/rrd-migrate.sh >/dev/null 2>&1 - if [ -d /var/log/rrd/collectd/localhost/interface/ ]; then - rm -Rf /var/log/rrd/collectd/localhost/interface/ - fi + rm -rf \ + /var/log/rrd/collectd/localhost/cpufreq + /var/log/rrd/collectd/localhost/interface + /var/log/rrd/collectd/localhost/thermal-thermal_zone*/temperatur-temperatur.rrd + + # start collectd after restore + /etc/rc.d/init.d/collectd start return 0 } diff --git a/config/rootfiles/core/192/update.sh b/config/rootfiles/core/192/update.sh index 7822bb24c..0ca3bad1a 100644 --- a/config/rootfiles/core/192/update.sh +++ b/config/rootfiles/core/192/update.sh @@ -44,6 +44,7 @@ for (( i=1; i<=$core; i++ )); do done # Stop services +/etc/rc.d/init.d/collectd stop KVER="xxxKVERxxx" @@ -105,17 +106,19 @@ ldconfig # Filesytem cleanup /usr/local/bin/filesystem-cleanup -# Start services -/etc/init.d/suricata restart - # Create collectd 4.x to 5.x migration script from rrd contents, run the script that # was created and then remove the old interface directory if it is present as it will # be empty after the migration has been carried out. /var/ipfire/collectd-migrate-4-to-5.pl --indir /var/log/rrd/ > /tmp/rrd-migrate.sh sh /tmp/rrd-migrate.sh >/dev/null 2>&1 -if [ -d /var/log/rrd/collectd/localhost/interface/ ]; then - rm -Rf /var/log/rrd/collectd/localhost/interface/ -fi + rm -rf \ + /var/log/rrd/collectd/localhost/cpufreq + /var/log/rrd/collectd/localhost/interface + /var/log/rrd/collectd/localhost/thermal-thermal_zone*/temperatur-temperatur.rrd + +# Start services +/etc/init.d/collectd start +/etc/init.d/suricata restart # Build initial ramdisks dracut --regenerate-all --force