- Update haproxy download URL and hash - Add new patches - Add several CFLAGS (derived from haproxy Makefile) to make the build work with v1.9+ - Update default configuration - Add check-command (for config) to init-script - Add prometheus-service from contribs by default Signed-off-by: Christian Lachner <gladiac@gmail.com>
29 lines
548 B
Bash
29 lines
548 B
Bash
#!/bin/sh /etc/rc.common
|
|
# Copyright (C) 2009-2010 OpenWrt.org
|
|
|
|
START=99
|
|
STOP=80
|
|
|
|
SERVICE_USE_PID=1
|
|
EXTRA_COMMANDS="check"
|
|
|
|
HAPROXY_BIN="/usr/sbin/haproxy"
|
|
HAPROXY_CONFIG="/etc/haproxy.cfg"
|
|
HAPROXY_PID="/var/run/haproxy.pid"
|
|
|
|
start() {
|
|
service_start $HAPROXY_BIN -q -D -f "$HAPROXY_CONFIG" -p "$HAPROXY_PID"
|
|
}
|
|
|
|
stop() {
|
|
kill -9 $(cat $HAPROXY_PID | tr "\n" " ")
|
|
service_stop $HAPROXY_BIN
|
|
}
|
|
|
|
reload() {
|
|
$HAPROXY_BIN -D -q -f $HAPROXY_CONFIG -p $HAPROXY_PID -sf $(cat $HAPROXY_PID)
|
|
}
|
|
|
|
check() {
|
|
$HAPROXY_BIN -c -q -V -f $HAPROXY_CONFIG
|
|
}
|