fix: mkdir -p /opt/wallarm before bind mount, fix status parsing
This commit is contained in:
parent
06c1ecfe85
commit
d277d976d0
1 changed files with 8 additions and 5 deletions
|
|
@ -183,6 +183,7 @@ WorkingDirectory={BASE}/%i/wallarm
|
|||
EnvironmentFile=-{BASE}/%i/wallarm/env.list
|
||||
# Private mount namespace isolates /opt/wallarm per instance
|
||||
PrivateMounts=yes
|
||||
ExecStartPre=/bin/mkdir -p /opt/wallarm
|
||||
ExecStartPre=/bin/mount --bind {BASE}/%i/wallarm /opt/wallarm
|
||||
ExecStartPre=-{BASE}/%i/wallarm/nginx/sbin/nginx -c {BASE}/%i/wallarm/nginx/conf/nginx.conf
|
||||
ExecStartPre=/bin/sleep 1
|
||||
|
|
@ -223,13 +224,15 @@ def show_status():
|
|||
return
|
||||
print("\n─── Node Status ───")
|
||||
for line in r.stdout.strip().split("\n"):
|
||||
# Parse: "wallarm-node@srv1.service loaded active running ..."
|
||||
# Format: "● wallarm-node@srv1.service loaded active ..."
|
||||
# or: " wallarm-node@srv1.service loaded active ..."
|
||||
line = line.lstrip('●○● ○')
|
||||
parts = line.split()
|
||||
if len(parts) >= 4 and '@' in parts[0]:
|
||||
if len(parts) >= 3 and '@' in parts[0]:
|
||||
name = parts[0].split('@')[1].replace(".service", "")
|
||||
active = parts[3] if len(parts) > 3 else "unknown"
|
||||
status = "●" if active == "active" or active == "running" else "○"
|
||||
print(f" {status} {name} — {active}")
|
||||
active = parts[2] if parts[1] == "active" else parts[1]
|
||||
status = "●" if parts[1] == "active" else "○"
|
||||
print(f" {status} {name} — {parts[1]} {parts[2] if len(parts)>2 else ''}")
|
||||
|
||||
# ─── Tunnel ────────────────────────────────────────────────────────────
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue