Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove systemd-resolved, explicitly install systemd-hwe-hwdb on noble #7466

Merged
merged 2 commits into from
Mar 11, 2025

Conversation

legoktm
Copy link
Member

@legoktm legoktm commented Mar 6, 2025

Status

Ready for review

Description of Changes

These two packages are installed on fresh systems, but not on upgrades because they were split out of the systemd package. Set the dependency ourselves to make sure it's always pulled in. [see discussion below]

In the future once all SecureDrops are on noble, we can uninstall systemd-resolved entirely instead of merely stopping it.

Fixes #7464.

Testing

  • CI passes (verifies conditional dependency is correctly applied)
  • staging CI passes, verifies fresh install is fine
  • do a focal to noble upgrade with these packages, verify systemd-resolved is not installed post-upgrade, /etc/resolv.conf points to your configured DNS, and e.g. curl https://securedrop.org works since DNS is working.
  • verify that ./securedrop-admin install works post-upgrade.

Deployment

Any special considerations for deployment? upgrade is more important.

@legoktm legoktm requested a review from a team as a code owner March 6, 2025 19:31
@legoktm
Copy link
Member Author

legoktm commented Mar 7, 2025

Unfortunately this correctly installs systemd-resolved, but then that gets enabled and is actively running post-upgrade. So we need a postinst step to re-disable it. Will work on that tomorrow.

@legoktm legoktm force-pushed the stg-systemd-resolved branch from 51e15bf to 7107b1d Compare March 7, 2025 14:59
@legoktm
Copy link
Member Author

legoktm commented Mar 7, 2025

This is going even more poorly; once we install systemd-resolved, it blows away /etc/resolv.conf, so when we turn it off, there's no DNS. Since DNS is configured by the admin, it's not something we can directly recreate (we could do the backup/restore strategy, like iptables).

So I'm going to switch gears and just have us not install systemd-resolved. Unfortunately this invalidates our fresh install testing but I think it's going to work out better.

@legoktm legoktm force-pushed the stg-systemd-resolved branch from 7107b1d to c7bb893 Compare March 7, 2025 16:37
@legoktm legoktm changed the title Explicitly install systemd-resolved, systemd-hwe-hwdb on noble Remove systemd-resolved, explicitly install systemd-hwe-hwdb on noble Mar 7, 2025
legoktm added 2 commits March 7, 2025 11:41
We don't use systemd-resolved and during the focal -> noble migration,
it gets dropped since it was split out to a separate package.

Now that we can remove it entirely, let's have noble installs absent the
package instead of merely stopping the systemd unit.

Fixes #7464.
This package is installed on fresh systems, but not on upgrades because
it was split out of the systemd package. Set the dependency ourselves to
make sure it's always pulled in.

Currently none of these udev rules apply to expected SecureDrop
hardware, but it's good to futureproof ourselves just in case.
@legoktm legoktm force-pushed the stg-systemd-resolved branch from c7bb893 to 52106d9 Compare March 7, 2025 16:41
@legoktm
Copy link
Member Author

legoktm commented Mar 7, 2025

It worked!! I can confirm that:

  • doing a focal -> noble migration leaves you with a system without systemd-resolved, and still working DNS (status quo before this PR). systemd-hwe-hwdb is pulled in.
  • after that, running ./securedrop-admin --force install (using this PR), will not fail, and the line to remove systemd-resolved is marked as "ok" and not "changed".
  • And even after that DNS still works.

I didn't manually test a noble fresh install because staging CI does that for us, and it worked as expected:

2025-03-07T16:57:17.6852219Z TASK [common : Disable systemd-resolved (focal)] *******************************
2025-03-07T16:57:17.6997915Z skipping: [app-staging]
2025-03-07T16:57:17.7069178Z skipping: [mon-staging]
2025-03-07T16:57:17.7126125Z 
2025-03-07T16:57:17.7126715Z TASK [common : Uninstall systemd-resolved (noble)] *****************************
2025-03-07T16:57:22.0994976Z changed: [app-staging]
2025-03-07T16:57:22.1548691Z changed: [mon-staging]

@legoktm legoktm added this to the SecureDrop 2.12.0 milestone Mar 11, 2025
@rocodes rocodes self-assigned this Mar 11, 2025
@rocodes
Copy link
Contributor

rocodes commented Mar 11, 2025

Per release checkin meeting today, I will visually review, relying on CI + @legoktm 's prior testing. We will incorporate further testing as part of regular rc QA test plan.

Copy link
Contributor

@rocodes rocodes left a comment

Choose a reason for hiding this comment

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

I've caught up with the context in #7464, the initial implementation plan, and the subsequent decision to remove systemd-resolved instead of installing everywhere, and I've reviewed the changes here- at first the systemd depends in the control file was slightly confusing given that context, but I see that it is conditionally pulling in the systemd-hwe-hwdb dependency for noble.

Thanks for all the documentation and for resolving this so quickly @legoktm - LGTM. Will look out for the backport.

@rocodes rocodes added this pull request to the merge queue Mar 11, 2025
Merged via the queue into develop with commit 9542cf7 Mar 11, 2025
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Instance upgraded from focal to noble is missing systemd-resolved
2 participants