From bbde4cb1e9d9d8125008a859e17c85c06c495bfc Mon Sep 17 00:00:00 2001 From: cppla Date: Fri, 27 Feb 2026 17:52:03 +0800 Subject: [PATCH] fix bug --- README.md | 2 +- docker-compose-client.yml | 26 +++++++++++++------------- docker-compose-server.yml | 3 +-- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index ac042cd..dd8fdc2 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ docker build -f Dockerfile.server -t serverstatus-server . wget --no-check-certificate -qO client-linux.py 'https://raw.githubusercontent.com/cppla/ServerStatus/master/clients/client-linux.py' && nohup python3 client-linux.py SERVER={$SERVER} USER={$USER} >/dev/null 2>&1 & `Docker`: -docker run -d --restart=always --name=serverstatus-client --network=host -e SERVER=127.0.0.1 -e USER=s01 cppla/serverstatus:client +docker run -d --restart=always --name=serverstatus-client --network=host --pid=host -e SERVER=127.0.0.1 -e USER=s01 cppla/serverstatus:client `Docker-compose`: docker compose -f docker-compose-client.yml up -d diff --git a/docker-compose-client.yml b/docker-compose-client.yml index d39aece..59414f4 100644 --- a/docker-compose-client.yml +++ b/docker-compose-client.yml @@ -1,4 +1,3 @@ -version: "3" services: serverstatus-client: build: @@ -8,16 +7,17 @@ services: container_name: serverstatus-client restart: unless-stopped network_mode: host + pid: host environment: - SERVER: "${SERVER:-127.0.0.1}" - USER: "${USER:-s01}" - PORT: "${PORT:-35601}" - PASSWORD: "${PASSWORD:-USER_DEFAULT_PASSWORD}" - INTERVAL: "${INTERVAL:-1}" - PROBEPORT: "${PROBEPORT:-80}" - PROBE_PROTOCOL_PREFER: "${PROBE_PROTOCOL_PREFER:-ipv4}" - PING_PACKET_HISTORY_LEN: "${PING_PACKET_HISTORY_LEN:-100}" - CU: "${CU:-cu.tz.cloudcpp.com}" - CT: "${CT:-ct.tz.cloudcpp.com}" - CM: "${CM:-cm.tz.cloudcpp.com}" - CLIENT: "${CLIENT:-linux}" + SERVER: "${SERVERSTATUS_SERVER:-127.0.0.1}" + USER: "${SERVERSTATUS_USER:-s01}" + PORT: "${SERVERSTATUS_PORT:-35601}" + PASSWORD: "${SERVERSTATUS_PASSWORD:-USER_DEFAULT_PASSWORD}" + INTERVAL: "${SERVERSTATUS_INTERVAL:-1}" + PROBEPORT: "${SERVERSTATUS_PROBEPORT:-80}" + PROBE_PROTOCOL_PREFER: "${SERVERSTATUS_PROBE_PROTOCOL_PREFER:-ipv4}" + PING_PACKET_HISTORY_LEN: "${SERVERSTATUS_PING_PACKET_HISTORY_LEN:-100}" + CU: "${SERVERSTATUS_CU:-cu.tz.cloudcpp.com}" + CT: "${SERVERSTATUS_CT:-ct.tz.cloudcpp.com}" + CM: "${SERVERSTATUS_CM:-cm.tz.cloudcpp.com}" + CLIENT: "${SERVERSTATUS_CLIENT:-linux}" diff --git a/docker-compose-server.yml b/docker-compose-server.yml index ecfc585..de3ddad 100644 --- a/docker-compose-server.yml +++ b/docker-compose-server.yml @@ -1,4 +1,3 @@ -version: "3" services: serverstatus-server: build: @@ -11,7 +10,7 @@ services: timeout: 10s retries: 5 container_name: serverstatus-server - restart: unless-stopped + restart: unless-stoppeddocker-compose-server.yml networks: serverstatus-network: ipv4_address: 172.23.0.2