Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/katello/tracer/deb.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import
from os import path
import subprocess
import sys

try:
from shutil import which
except ImportError: # on Python 2
Expand Down Expand Up @@ -38,6 +38,16 @@ def needrestart():
raise SystemExit("Please install needrestart")


def generate_restart_command(service):
if service == "dbus-broker":
cmd = "systemctl restart dbus"
Comment on lines +42 to +43
Copy link
Member

Choose a reason for hiding this comment

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

Where does dbus-broker come from? I don't see that on my Debian 12 system.

Copy link
Member Author

Choose a reason for hiding this comment

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

I got these special treatments from [1] and tried to apply the most useful of them. We got a system on which we had the systemd-manager issue.

[1] https://github.com/liske/needrestart/tree/master/ex/restart.d

elif service == "systemd-manager":
cmd = "systemctl daemon-reexec"
else:
cmd = "systemctl restart " + service
return cmd


def use_needrestart():
apps = []
services = []
Expand All @@ -55,7 +65,8 @@ def use_needrestart():
apps.append(app)

for service in services:
app = AptTracerApp(service, "systemctl restart " + service, "daemon")
cmd = generate_restart_command(service)
app = AptTracerApp(service, cmd, "daemon")
apps.append(app)

return apps
Expand Down