mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-01-30 20:56:39 +00:00
feature(services): hook up the root daemon client
This commit is contained in:
parent
bb6d59e29f
commit
ad1076ad4f
|
@ -241,23 +241,23 @@ class Service(ABC):
|
||||||
def stop(cls):
|
def stop(cls):
|
||||||
"""Stop the service. Usually this means stopping systemd unit."""
|
"""Stop the service. Usually this means stopping systemd unit."""
|
||||||
for unit in cls.get_units():
|
for unit in cls.get_units():
|
||||||
run(["systemctl", "stop", unit], check=False)
|
# run(["systemctl", "stop", unit], check=False)
|
||||||
# TODO: use root separation daemon:
|
# TODO: use root separation daemon:
|
||||||
# call_root_function(["systemctl", "stop", unit])
|
call_root_function(["systemctl", "stop", unit])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def start(cls):
|
def start(cls):
|
||||||
"""Start the service. Usually this means starting systemd unit."""
|
"""Start the service. Usually this means starting systemd unit."""
|
||||||
for unit in cls.get_units():
|
for unit in cls.get_units():
|
||||||
run(["systemctl", "start", unit], check=False)
|
# run(["systemctl", "start", unit], check=False)
|
||||||
# call_root_function(["systemctl", "start", unit])
|
call_root_function(["systemctl", "start", unit])
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def restart(cls):
|
def restart(cls):
|
||||||
"""Restart the service. Usually this means restarting systemd unit."""
|
"""Restart the service. Usually this means restarting systemd unit."""
|
||||||
for unit in cls.get_units():
|
for unit in cls.get_units():
|
||||||
run(["systemctl", "restart", unit], check=False)
|
# run(["systemctl", "restart", unit], check=False)
|
||||||
# call_root_function(["systemctl", "restart", unit])
|
call_root_function(["systemctl", "restart", unit])
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_configuration(cls):
|
def get_configuration(cls):
|
||||||
|
|
Loading…
Reference in a new issue