Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions ovos_utils/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ def restart_service(service_name, sudo=True):
@param service_name: name of service to restart
@param sudo: use sudo when calling systemctl
"""
cmd = f'systemctl restart {service_name}'
if sudo:
cmd = f"sudo {cmd}"
cmd = f"systemctl restart --user {service_name}"
else:
cmd = f'sudo systemctl restart {service_name}'
subprocess.call(cmd, shell=True)


Expand Down