mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] Use systemctl for all service operations
This commit is contained in:
parent
fd23216544
commit
164377d599
1 changed files with 2 additions and 5 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue