fix(luci-app-haproxy): Correct container name in RPCD backend
Change container references from 'haproxy-lxc' to 'haproxy' to match the actual container name used by secubox-app-haproxy. This fixes the LuCI status view showing container_running: false. Fixes affected methods: - method_status: container existence and state checks - method_get_stats: container running check Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a91bd48c3a
commit
47b2e1b8e1
@ -55,15 +55,15 @@ method_status() {
|
|||||||
stats_enabled=$(get_uci main stats_enabled 1)
|
stats_enabled=$(get_uci main stats_enabled 1)
|
||||||
|
|
||||||
# Check container status
|
# Check container status
|
||||||
if lxc-info -n haproxy-lxc >/dev/null 2>&1; then
|
if lxc-info -n haproxy >/dev/null 2>&1; then
|
||||||
container_running=$(lxc-info -n haproxy-lxc -s 2>/dev/null | grep -q "RUNNING" && echo "1" || echo "0")
|
container_running=$(lxc-info -n haproxy -s 2>/dev/null | grep -q "RUNNING" && echo "1" || echo "0")
|
||||||
else
|
else
|
||||||
container_running="0"
|
container_running="0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check HAProxy process in container
|
# Check HAProxy process in container
|
||||||
if [ "$container_running" = "1" ]; then
|
if [ "$container_running" = "1" ]; then
|
||||||
haproxy_running=$(lxc-attach -n haproxy-lxc -- pgrep haproxy >/dev/null 2>&1 && echo "1" || echo "0")
|
haproxy_running=$(lxc-attach -n haproxy -- pgrep haproxy >/dev/null 2>&1 && echo "1" || echo "0")
|
||||||
else
|
else
|
||||||
haproxy_running="0"
|
haproxy_running="0"
|
||||||
fi
|
fi
|
||||||
@ -83,7 +83,7 @@ method_status() {
|
|||||||
method_get_stats() {
|
method_get_stats() {
|
||||||
local stats_output
|
local stats_output
|
||||||
|
|
||||||
if lxc-info -n haproxy-lxc -s 2>/dev/null | grep -q "RUNNING"; then
|
if lxc-info -n haproxy -s 2>/dev/null | grep -q "RUNNING"; then
|
||||||
# Get stats via HAProxy socket
|
# Get stats via HAProxy socket
|
||||||
stats_output=$(run_ctl stats 2>/dev/null)
|
stats_output=$(run_ctl stats 2>/dev/null)
|
||||||
if [ -n "$stats_output" ]; then
|
if [ -n "$stats_output" ]; then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user