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 pkg.services_need_restart #58262
Conversation
3e2c295
to
0db9e0c
Compare
dbad856
to
e3c8f19
Compare
8b096dc
to
ddae832
Compare
I'll fix the CI complains due to the Python2 removal and push the changes asap, hopefully tomorrow. |
9bcb85c
to
3af77bc
Compare
a9036bb
to
d41a37d
Compare
771991d
to
ce52020
Compare
74a900a
to
e5b24fb
Compare
b240ffa
to
6ce02c7
Compare
6ce02c7
to
731b477
Compare
Unfortunately the virtual package must be manually resolved. Also note PR saltstack#58262 is implementing the service restart checks. It is arguable whether it should be included, as technically you do not need a full reboot.
731b477
to
a9369b0
Compare
a9369b0
to
0cecb75
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.
One small change. I would love to get this into 3003, but we will be tagging any day now so I cannot guarantee this.
salt/modules/aptpkg.py
Outdated
|
||
def services_need_restart(**kwargs): | ||
""" | ||
.. versionadded:: NEXT |
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.
this needs to be 3003
salt/modules/yumpkg.py
Outdated
|
||
def services_need_restart(**kwargs): | ||
""" | ||
.. versionadded:: NEXT |
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.
3003
salt/modules/zypperpkg.py
Outdated
|
||
def services_need_restart(root=None, **kwargs): | ||
""" | ||
.. versionadded:: NEXT |
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.
3003
This function translates a given PID to the systemd service name in case the process belongs to a running service. It uses DBUS for the translation if DBUS is available, falling back to parsing ``systemctl status -o json'' output.
pkg.services_need_restart returns a list of system services that were affected by package manager operations such as updates, downgrades or reinstallations without having been restarted. This might cause issues, e.g. in the case a shared object was loaded by a process and then replaced by the package manager.
pkg.services_need_restart returns a list of system services that were affected by package manager operations such as updates, downgrades or reinstallations without having been restarted. This might cause issues, e.g. in the case a shared object was loaded by a process and then replaced by the package manager. Requires checkrestart, which is part of the debian-goodies package and available from official Ubuntu and Debian repositories.
pkg.services_need_restart returns a list of system services that were affected by package manager operations such as updates, downgrades or reinstallations without having been restarted. This might cause issues, e.g. in the case a shared object was loaded by a process and then replaced by the package manager. Requires dnf with the needs-restarting plugin, which is part of dnf-plugins-core and installed by default on RHEL/CentOS/Fedora. Also requires systemd for the mapping between PIDs and systemd services.
Co-authored-by: Wayne Werner <waynejwerner@gmail.com>
0cecb75
to
d89a3e8
Compare
@Ch3LL good catch! I've changed the NEXT to 3003 in all three pkg modules |
What does this PR do?
Add
pkg.services_need_restarting
to Zypper, Yum(DNF) and Apt.Current name proposal is
pkg.services_need_restarting
, but I don't mind changing the name to a better one if suggested.What issues does this PR fix or reference?
Fixes: #58261
New Behavior
Merge requirements satisfied?
Commits signed with GPG?
Yes (always ;))