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