secubox-openwrt/package/secubox/secubox-app-haproxy/files/etc/init.d/haproxy
CyberMind-FR 172fd42072 fix(secubox-app-haproxy): Consistent pidfile name in init.d
Change pidfile from haproxy-lxc.pid to haproxy.pid for consistency
with the actual container name.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-24 15:34:01 +01:00

39 lines
649 B
Bash

#!/bin/sh /etc/rc.common
# SecuBox HAProxy Service
# Copyright (C) 2025 CyberMind.fr
START=90
STOP=10
USE_PROCD=1
NAME="haproxy"
PROG="/usr/sbin/haproxyctl"
start_service() {
local enabled
config_load haproxy
config_get enabled main enabled '0'
[ "$enabled" = "1" ] || return 0
procd_open_instance
procd_set_param command "$PROG" service-run
procd_set_param respawn 3600 5 0
procd_set_param stdout 1
procd_set_param stderr 1
procd_set_param pidfile /var/run/haproxy.pid
procd_close_instance
}
stop_service() {
"$PROG" service-stop
}
reload_service() {
"$PROG" reload
}
service_triggers() {
procd_add_reload_trigger "haproxy"
}