Project

General

Profile

Actions

Feature #12518

closed

Restore RRD and extra data from configuration backups when restoring during installation

Added by Viktor Gurov about 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Viktor Gurov
Category:
Installer
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
22.01
Release Notes:
Default

Description

Currently bsdinstall script simply removes any extra data or RRD data from the config.xml:
https://github.com/pfsense/FreeBSD-src/blob/devel-12/usr.sbin/bsdinstall/scripts/copy_configxml_from_usb#L67:

# Remove rrddata/xmldata if it is present, see https://redmine.pfsense.org/issues/11050
    REMOVE_DATA="rrddata captiveportaldata dhcpddata dhcpdv6data voucherdata sshdata" 
    for remdata in $REMOVE_DATA; do
        sed -i '' -e "/<$remdata>/,/<\/$remdata>/ d" ${recovery_dir}/config.xml
    done

it's better to keep this data, but add /cf/conf/config/bsdinstall_config_restore flag to run restore_backup() on boot

Actions #2

Updated by Jim Pingle almost 3 years ago

  • Status changed from New to Pull Request Review
  • Assignee set to Viktor Gurov
  • Target version set to 2.6.0
  • Plus Target Version set to 22.01
Actions #3

Updated by Viktor Gurov almost 3 years ago

  • Status changed from Pull Request Review to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Jim Pingle almost 3 years ago

  • Subject changed from Restore RRD and extra data on bsdinstall config.xml restore to Restore RRD and extra data from configuration backups when restoring during installation

Updating subject for release notes.

Actions #5

Updated by Viktor Gurov almost 3 years ago

bsdinstaller does not create the '/cf/conf/trigger_restore_config_after_bsdinstall' file for some reason (https://github.com/pfsense/FreeBSD-src/blob/devel-12/usr.sbin/bsdinstall/scripts/copy_configxml_from_usb#L66)

if this file is created manually ("touch /cf/conf/trigger_restore_config_after_bsdinstall"), it will successfully restore extra data

Actions #7

Updated by Jim Pingle almost 3 years ago

  • Status changed from Feedback to Pull Request Review
Actions #8

Updated by Jim Pingle almost 3 years ago

  • Status changed from Pull Request Review to Feedback

Already merged.

Actions #9

Updated by Jim Pingle almost 3 years ago

  • Status changed from Feedback to New

This can be activated unintentionally on upgrade the way it is now. It looks like the installer made /conf/installer_copied_config when it restored a config in the past, but that file was never removed when the system finished booting after installation. Because it wasn't removed, some systems may still have that file present even though they haven't been (re)installed in months or more. As a consequence, on upgrade this new code triggers and they get a notification about the restore. It should end up being a NOOP but the notification may still confuse users.

pfSense is restoring the configuration /tmp/config_to_restore.xml @ 2022-01-05 09:31:06

This should probably also look for some other indication that it's the first boot post install, such as the presence of {$g['conf_path']}/trigger_initial_wizard

Actions #11

Updated by Jim Pingle almost 3 years ago

  • Status changed from New to Pull Request Review
Actions #12

Updated by Viktor Gurov almost 3 years ago

  • Status changed from Pull Request Review to Feedback

Merged

Actions #13

Updated by Jim Pingle almost 3 years ago

  • Status changed from Feedback to Closed
Actions

Also available in: Atom PDF