]> git.ipfire.org Git - people/mfischer/ipfire-2.x.git/commitdiff
core192: fix some collectd convertion issues
authorArne Fitzenreiter <arne_f@ipfire.org>
Sun, 26 Jan 2025 10:41:54 +0000 (11:41 +0100)
committerArne Fitzenreiter <arne_f@ipfire.org>
Sun, 26 Jan 2025 10:41:54 +0000 (11:41 +0100)
Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
config/backup/backup.pl
config/rootfiles/core/192/update.sh

index 959804b591634578bdad493ef12958e6a9eb6b0f..07b8094418eb2783aa0fd777f6760dada07e987e 100644 (file)
@@ -2,7 +2,7 @@
 ###############################################################################
 #                                                                             #
 # IPFire.org - A linux based firewall                                         #
-# Copyright (C) 2007-2024  IPFire Team  <info@ipfire.org>                     #
+# Copyright (C) 2007-2025  IPFire Team  <info@ipfire.org>                     #
 #                                                                             #
 # 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
 }
index 7822bb24ca5ebaa6c10eca4e1edde3928e101af4..0ca3bad1aef96ee6a3bac6c16acc15d0f791f333 100644 (file)
@@ -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