Skip to content

Commit b64c4d3

Browse files
committed
Add special treatment of certain deb services
For certain debian services a special treatment is necessary to resolve the traces of the system.
1 parent 693520b commit b64c4d3

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/katello/tracer/deb.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from __future__ import absolute_import
22
from os import path
33
import subprocess
4-
import sys
4+
55
try:
66
from shutil import which
77
except ImportError: # on Python 2
@@ -38,6 +38,17 @@ def needrestart():
3838
raise SystemExit("Please install needrestart")
3939

4040

41+
def generate_restart_command(service):
42+
cmd = "systemctl restart " + service
43+
44+
if service == "dbus-broker":
45+
cmd = "systemctl restart dbus"
46+
elif service == "systemd-manager":
47+
cmd = "systemctl daemon-reexec"
48+
49+
return cmd
50+
51+
4152
def use_needrestart():
4253
apps = []
4354
services = []
@@ -55,7 +66,8 @@ def use_needrestart():
5566
apps.append(app)
5667

5768
for service in services:
58-
app = AptTracerApp(service, "systemctl restart " + service, "daemon")
69+
cmd = generate_restart_command(service)
70+
app = AptTracerApp(service, cmd, "daemon")
5971
apps.append(app)
6072

6173
return apps

0 commit comments

Comments
 (0)