Tracer for DNF

I’m currently analyzing an isuse, that a tracer information is shown, that rsyslog need to be restarted, but it’s not necessary: tracer wants me to unnecessarily restart services · Issue #126 · FrostyX/tracer · GitHub

Currently, the python lib tracer is only necessary for EL because it failed for suse and debian:

What do you think to drop the tracer dependency in katello-host-tools and use “dnf needs-restarting” instead to determine if process restart or reboot is necessary: DNF needs-restarting Plugin — dnf-plugins-core 4.4.2-1 documentation

I don’t remember why we were not using this 100% @Jonathon_Turel do you remember why?

Thoughts: Use dnf needs-restarting to collect tracer information by sbernhard · Pull Request #149 · Katello/katello-host-tools · GitHub

Tracer is integrated in several places in Katello. There are at least two UI pages. The tracer “helpers” (restart commands) are saved in the Katello database. There are job templates to run tracer commands. It seems like all of the above would need rearchitecting; is this what you are proposing? Also katello-host-tools-tracer is packaged. I think this would also need some inputs from @packaging folks.

The target of this PR is, that everything stays the same but uses a different technology - “dnf needs-restarting”.
“dnf needs-restarting” should not have the issue mentioned in tracer wants me to unnecessarily restart services · Issue #126 · FrostyX/tracer · GitHub
(tracer expects a service should be restarted, even it was restarted during rpm post install routine from dnf - dnf needs-restarting does not print that the service needs to be restarted).

Of course, packaging needs to be done afterwards and hopefully, we can skip the python3-tracer delivery if we only need >= el8

1 Like

Just for the reason of curiosity, how will it work on Ubuntu/Debian/OpenSUSE/SLES then, where dnf/yum is not in use? :slight_smile:

this is already implemented in a completely different way.
See and

1 Like

Ah okay cool! Thank you for the hint :slight_smile:

We should keep supporting EL7 clients. We’re even still making sure not to totally break EL6 folks as far as I’m aware.

The idea of dropping a dependency would be great, but we’ll need to keep it around a bit longer anyway for EL7. Plus it seems like we’re losing support for “session” restart types where the user just needs to log out and log back in.

Has fixing the tracer bug directly been investigated?

Otherwise we’ll likely need to pull more code from tracer into katello-host-tools for the session type determination.

I will try to add the session type but I’m still unsure for which use cases they are used.

I had a look at the tracer issue. Unfortunately, this issue exists for a long time. Additionally, why should it use another library like the tracer package if ‘dnf’ is able to provide the same information.

For CentOS <= 7 we can still use python3-tracer.

1 Like

Before replacing tracer it makes sense to me to confirm that we aren’t going to lose any functionality.

If we need to rebuild part of tracer’s functionality just to make dnf-needs-restarting work, wouldn’t it be easier just to keep tracer?

Is dnf needs-restarting able to be configured to automatically upload tracer information on any package action?

Instead of replacing the whole infrastructure, there are a few other possibilities.

  • Fix the bug in tracer
  • Or, what about adding the ability to “clear” or “mute” a host trace? (Sort of like you can do with host statuses.)

Dropping a dependency can be very useful, even if we only do so on EL8+ and keep it for EL7 (and older). Tracer has some non-trivial amount of dependencies. Allowing to drop them will be good for users. For example, we can stop packaging python-psutil on EL8+ in the client repo if we go this route.

We should also note that today we’ve packaged tracer 0.7.8 while 1.1 is already out. Clearly we’re not keeping up.

So as long as there’s no regression in functionality, there are real benefits even if we keep it for EL7.


I was able to “get back” the session type using the new dnf needs-restarting method.

Thanks to @ekohl with a lot of very useful comments in the PR it looks pretty clean now.

1 Like

PR is merged! Now we just need a new release of katello-host-tools.