Skip to content

RPM: fix restarting bareos-fd on upgrades from bareos <= 24#2395

Merged
BareosBot merged 2 commits intomasterfrom
dev/joergs/master/config-once-fix-rpm-restart
Oct 20, 2025
Merged

RPM: fix restarting bareos-fd on upgrades from bareos <= 24#2395
BareosBot merged 2 commits intomasterfrom
dev/joergs/master/config-once-fix-rpm-restart

Conversation

@joergsteffens
Copy link
Member

@joergsteffens joergsteffens commented Oct 15, 2025

Thank you for contributing to the Bareos Project!

On upgrade from Bareos <= 24 to Bareos >= 25 will fail to restart the bareos-fd properly, because this is done during %postun, while the config files only got restored in %postrans.
This PR creates a workaround for this.

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
  • Required backport PRs have been created
  • Correct milestone is set
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR
Tests
  • Manually tried the following
    • RHEL 8 upgrade from 19.2 with FD running
    • RHEL 9 upgrade from next with FD running
    • RHEL 10 upgrade from 24
      • with FD running
      • with FD stopped
      • with FD running and config broken
      • with FD stopped and config broken
    • SLE 15 upgrade from 23
      • with FD running
      • with FD stopped
      • with FD running and config broken
      • with FD stopped and config broken

@joergsteffens joergsteffens added the bug This addresses a bug label Oct 15, 2025
@joergsteffens joergsteffens added this to the 25.0.0 milestone Oct 15, 2025
@joergsteffens joergsteffens force-pushed the dev/joergs/master/config-once-fix-rpm-restart branch from a70f162 to 94562d3 Compare October 16, 2025 14:11
@joergsteffens joergsteffens requested a review from arogge October 16, 2025 14:12
@joergsteffens joergsteffens marked this pull request as ready for review October 16, 2025 14:12
@joergsteffens joergsteffens self-assigned this Oct 16, 2025
Copy link
Member

@arogge arogge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only odd things I could identify are:

  • RHEL 10 (at least in the repotest container) emits the message "warning: Unable to get systemd shutdown inhibition lock: Could not activate remote peer: activation request failed: unit is invalid." during upgrade, it seems this is not a problem though
  • RPM will tell you that it moves your modified configuration files to <xxx>.rpmsave, which is a bit weird given they will still be there after the upgrade.

As everything works correctly and it is a one-time operation for each installation, I'm happy with this.

joergsteffens and others added 2 commits October 20, 2025 06:03
On upgrade, the bareos-fd will be restarted (in %postun of the old
package).
When upgrading from Bareos < 25, we need a workaround to keep the
existing configuration files.
However, during the upgrade, some files get renamed
(because we can't prevent RPM from doing so).
We restore these files in %posttrans.
As another workaround,
we check if bareos-fd is running %pre.
If yes, we will start it again in %postrans.

This is only required for bareos-fd, as the other services don't got
restarted.
@BareosBot BareosBot force-pushed the dev/joergs/master/config-once-fix-rpm-restart branch from 37c4b18 to 075fd20 Compare October 20, 2025 06:03
@BareosBot BareosBot merged commit 5f5e7af into master Oct 20, 2025
@BareosBot BareosBot deleted the dev/joergs/master/config-once-fix-rpm-restart branch October 20, 2025 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug This addresses a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants