From b6f30d59e1395bb4fee14783613b364585dd6597 Mon Sep 17 00:00:00 2001 From: Lloyd Date: Tue, 30 Dec 2025 22:37:47 +0000 Subject: [PATCH] fix: Remove sudo from systemctl command for service restart --- repeater/web/api_endpoints.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/repeater/web/api_endpoints.py b/repeater/web/api_endpoints.py index 159f378..73995be 100644 --- a/repeater/web/api_endpoints.py +++ b/repeater/web/api_endpoints.py @@ -428,7 +428,8 @@ class APIEndpoints: import time time.sleep(2) # Give time for response to be sent try: - subprocess.run(['sudo', 'systemctl', 'restart', 'pymc-repeater'], check=False) + # Use systemctl without sudo - polkit rules allow the repeater user to restart the service + subprocess.run(['systemctl', 'restart', 'pymc-repeater'], check=False) except Exception as e: logger.error(f"Failed to restart service: {e}")