Update public source
This commit is contained in:
@@ -444,7 +444,8 @@ def systemctl_user(*arguments, check=True):
|
||||
return subprocess.run(
|
||||
command,
|
||||
check=check,
|
||||
text=True
|
||||
text=True,
|
||||
capture_output=True
|
||||
)
|
||||
|
||||
|
||||
@@ -466,6 +467,12 @@ def start_service():
|
||||
log("Менеджер уже запущен.")
|
||||
return 0
|
||||
|
||||
if port_is_open(APP_HOST, APP_PORT):
|
||||
raise LifecycleError(
|
||||
f"Порт приложения {APP_PORT} занят. "
|
||||
"Чужой процесс не будет остановлен."
|
||||
)
|
||||
|
||||
python = project_python()
|
||||
|
||||
if not python.is_file():
|
||||
@@ -578,10 +585,21 @@ def show_status():
|
||||
scanner = data.get("status", {})
|
||||
gps = data.get("gps_test", {})
|
||||
|
||||
print(
|
||||
"Scanner:",
|
||||
scanner.get("status", "unknown")
|
||||
scanner_running = scanner.get("running", False)
|
||||
scanner_health = scanner.get("health", "unknown")
|
||||
scanner_pid = scanner.get("pid")
|
||||
|
||||
if scanner_running:
|
||||
scanner_state = (
|
||||
f"RUNNING (PID {scanner_pid}, "
|
||||
f"health: {scanner_health})"
|
||||
)
|
||||
else:
|
||||
scanner_state = (
|
||||
f"STOPPED (health: {scanner_health})"
|
||||
)
|
||||
|
||||
print("Scanner:", scanner_state)
|
||||
print(
|
||||
"GPS test:",
|
||||
gps.get("state", "unknown")
|
||||
|
||||
Reference in New Issue
Block a user