-
Notifications
You must be signed in to change notification settings - Fork 73
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 VM support #216
Add VM support #216
Conversation
Thanks for the feedback @wgrant , There is a "quiet" flag -q already, but that isn't really helpful as-is IMHO.
With -q we'd in this case get only:
This is IMHO misleading at best, as it missed the header you don't know in the apt-output if it meas that it did a restart or suggests one (in this case it is the latter). It already has quiet and verbose mode. This can be done already on various levels. |
This one is more important IMHO - thanks @wgrant At first I need to clarify that it seems that when calling needrestart I can only assume, but think that it is other things part of the apt I had a look what is running at that time and the time consuming bit is This is odd, IIRC we had a bunch of activities to not slow down login I'll file a bug in update-notifier at some point and subscribe you ... |
Thanks for the PR. Would it also work with Xen VMs? I still need to take a closer look ;-) |
This is based on how libvirt puts guests into namespaces. |
9d4382a
to
ada0f8b
Compare
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'm almost fine with this PR, just a minor output issue.
Thanks!
Restarting virtlogd / virtlockd is really bad as guests would be fenced and restarted. This is intentionally skipped on the package upgrade [1] and tried to be the last that dies by upstream [2][3]. We should at least not preselect those services to avoid these issues, therefore add them to the default override config. [1]: https://salsa.debian.org/libvirt-team/libvirt/-/blob/debian/master/debian/rules#L254 [2]: https://libvirt.org/git/?p=libvirt.git;a=blob;f=src/logging/virtlogd.service.in;h=8ab547851772298ff570487f1ce2d3680c7e4d68;hb=HEAD#l13 [3]: https://libvirt.org/git/?p=libvirt.git;a=blob;f=src/locking/virtlockd.service.in;h=4a6fab05ab309a04a8565a5c73cbcfb47dae8d5d;hb=HEAD#l13 Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Needrestart is awesome in detecting long running services or user sessions that are still running with old binaries. But there is another common kind of long-running process - VM Guests. Detecting the common qemu/KVM guests and reporting those to the user will help them to realize that also those guests should be considered to be restarted (or migrated onto an updated host) Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
As discussed in the PR this shal avoid misunderstandings that we might scan inside the guest. Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
Thank you for your contribution! |
No problem, thanks for your patience with my low perl skill! |
Hi,
Needrestart is awesome in detecting long running services or user sessions that are still running with old binaries. But there is another common kind of long-running process - VM Guests.
On one hand this branch adds a bit of protection by greylisting common virtualization services which restart would break running guests.
On the other hand it adds detection and reporting of outdated VMs.
Here an example of a system running a KVM guest in libvirt:
And on package (re)install with a depending library
libspice-server1
we see the detection and reporting in action:The same in verbose/debug mode:
And in easy mode we get:
# needrestart -l -m e
=> "This system runs outdated binaries and outdated VM guests - you should consider rebooting! "Right now this only detects the "common" way of a libvirt/qemu setup for guests.
We could move it out of the session checks and try to parse ANY qemu processes if you prefer that.
Furthermore I had no idea what nagios would need/expect and no way to test it so this feature has no nagios support for now.
Please consider this overall as an RFC as I'd need your preference (do we want all qemu processes) and guidance (nagios).
Once discussions happened and this becomes more polished and tested we can un-tag the RFC label and hopefully consider it for inclusion.