Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add
reboot
option to DNF Automatic #1879Add
reboot
option to DNF Automatic #1879Changes from 1 commit
cafcd57
098de60
9f83e90
8d63b97
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to share this set with
needs-restarting
plugin somehow.One option would be a new config option. In this case it should be implemented also for dnf5.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm true, would doing this via a new config option require a change in libdnf?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, if we agree that it is useful, it will be spread across libdnf, dnf, dnf-plugins-core, and dnf5 :)
But I'm not gonna block this PR because of that. It could be done in subsequent patches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think we can hold off for now and err on the side of minimal changes. Hopefully this list doesn't change too much over the years. But it would be good for it to be configurable by the user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was testing your code today, and I was thinking whether our ci is suitable or not for testing what you want. Probably, there is no simple way to trigger a reboot, but there are other options.
Since you set a custom command here, I would think of another way to test the reboot trigger.
Maybe, during behave tests, you could set an arbitrary command in
etc/dnf/automatic.conf
. Let's say that instead ofshutdown -r
youtouch
some file, then you can check if the file exists and have the trigger tested. Unfortunately this is the only partial solution I came up with.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FTR: Cockpit's updates page delays the shutdown by a bit, so that logged in users get a warning and have some time to orderly stop their work. That's a good thing to do on servers IMHO.
That same thing also allows you to test this feature relatively painlessly: It's enough time to validate that a shutdown was scheduled and cancel it again (like in our tests). That avoids the costly (time) or impossible (Testing Farm/gating tests) actual reboot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea.
That does not apply for
dnf
, since we run our tests in containers. But you cannot really test if a system reboots universally. Say that a system does not have theshutdown
command, then the only thing you can test is to check if the hook triggers. It would be the user/sysadmin/distro responsibility to configure the conf file accordingly.Said that, it's not a big deal imho since we are not testing the capability of
shutdown -r
of rebooting the system.I think this would be the solution in most cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the input, I've made the default
reboot_command
add a 5-minute delay and wall message.@inknos how does rpm-software-management/ci-dnf-stack#1210 look? I set the
reboot_command
to echo a certain string, then check that stdout contains that string. Maybe touching a file is a more reliable way to make sure the command is actually run, but I think this should be sufficient.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the stoud approach, I will post some comments about the CI PR and then I believe this is good to go. Thank you