aboutsummaryrefslogtreecommitdiff
path: root/whatmaps/debiandistro.py
diff options
context:
space:
mode:
Diffstat (limited to 'whatmaps/debiandistro.py')
-rw-r--r--whatmaps/debiandistro.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/whatmaps/debiandistro.py b/whatmaps/debiandistro.py
index d608d8f..5333a35 100644
--- a/whatmaps/debiandistro.py
+++ b/whatmaps/debiandistro.py
@@ -34,6 +34,7 @@ import string
import distro
from . debianpkg import DebianPkg
from . pkg import PkgError
+from . systemd import Systemd
class DebianDistro(distro.Distro):
"Debian (dpkg) based distribution"
@@ -73,8 +74,12 @@ class DebianDistro(distro.Distro):
return DebianPkg(pkg)
@classmethod
- def restart_service_cmd(klass, name):
+ def restart_service_cmd(klass, service):
"""The command that should be used to start a service"""
+ if Systemd.is_running() and service.endswith('.service'):
+ name = service[:-len('.service')]
+ else:
+ name = service
return ['invoke-rc.d', name, 'restart']
@classmethod