fix: Remove sudo from systemctl command for service restart

This commit is contained in:
Lloyd
2025-12-30 22:37:47 +00:00
parent c24c39eab2
commit b6f30d59e1
+2 -1
View File
@@ -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}")