From 164377d5999aafc6523192539d4336c085a64477 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Mon, 27 Nov 2017 23:12:13 +0100 Subject: [PATCH] [mod] Use systemctl for all service operations --- src/yunohost/service.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/yunohost/service.py b/src/yunohost/service.py index 0861d05cd..f0948c961 100644 --- a/src/yunohost/service.py +++ b/src/yunohost/service.py @@ -498,11 +498,8 @@ def _run_service_command(action, service): raise MoulinetteError(errno.EINVAL, m18n.n('service_unknown', service=service)) cmd = None - if action in ['start', 'stop', 'restart', 'reload']: - cmd = 'service %s %s' % (service, action) - elif action in ['enable', 'disable']: - arg = 'defaults' if action == 'enable' else 'remove' - cmd = 'update-rc.d %s %s' % (service, arg) + if action in ['start', 'stop', 'restart', 'reload', 'enable', 'disable']: + cmd = 'systemctl %s %s' % (action, service) else: raise ValueError("Unknown action '%s'" % action)