summaryrefslogtreecommitdiff
path: root/whatmaps/debiandistro.py
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-07-11 17:23:10 +0200
committerGuido Günther <agx@sigxcpu.org>2014-07-11 20:02:35 +0200
commitf758314abe0c3c4cc2b06ca5a24c7288a0af41ed (patch)
tree7c1170065179a884031e8cf5d0d5f558edf25c17 /whatmaps/debiandistro.py
parent3ff8c7d8227119474543b0fd4dbee0817676472e (diff)
Add systemd support
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