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

network: start dnsconfd in initramfs #6200

Open
wants to merge 1 commit into
base: rhel-10
Choose a base branch
from

Conversation

rvykydal
Copy link
Contributor

@rvykydal rvykydal commented Feb 24, 2025

Resolves: RHEL-80302

I was trying to add dracut unit test (like here) but the logic is very sparse here and we'd need to figure so much mocking (boot options, existing files) that I gave up. The only option seemed to me to test a function that would take all the possible contitions as parameters (like "can_import_certificates_later", ore "is_required_by_boot_options") and let an (untested) wrapper collect the parameters.

@rvykydal rvykydal force-pushed the start-dnsconfd-in-initramfs-r10 branch from 0ac32b7 to e59efe7 Compare February 24, 2025 08:24
@rvykydal
Copy link
Contributor Author

/kickstart-test --testtype smoke

Copy link
Member

@jkonecny12 jkonecny12 left a comment

Choose a reason for hiding this comment

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

Looks good to me. It is just getting more logic to Dracut than I would like. However, I don't know about a better solution.

fi

if [ "${start}" == "yes" ]; then
echo "Attempting to start dnsconfd. Starting."
Copy link
Member

Choose a reason for hiding this comment

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

I think you can just write it starting as this shouldn't be just an attempt.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted make easier matching the message to the previous related log message Attempting to start dnsconfd. Reason: ${reason} when looking at the log.

if [ "${start}" == "yes" ]; then
echo "Attempting to start dnsconfd. Starting."
systemctl start --no-block unbound.service
return 0
Copy link
Member

Choose a reason for hiding this comment

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

Don't we want to have return $? instead to catch possible failure?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we'd care more about the information 'should the service be started now?'. The return value is not needed anywhere anyway. I think at this point it is just too early complicate the things by figuring stable expected return values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants