mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
haproxy: move haproxy to core
Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
This commit is contained in:
1
config/cfgroot/haproxy-settings
Normal file
1
config/cfgroot/haproxy-settings
Normal file
@@ -0,0 +1 @@
|
||||
ENABLE_HAPROXY=off
|
||||
8
config/rootfiles/common/haproxy
Normal file
8
config/rootfiles/common/haproxy
Normal file
@@ -0,0 +1,8 @@
|
||||
etc/haproxy/haproxy.cfg
|
||||
etc/logrotate.d/haproxy
|
||||
etc/rc.d/init.d/haproxy
|
||||
etc/rc.d/rc3.d/S35haproxy
|
||||
usr/sbin/haproxy
|
||||
var/ipfire/backup/addons/includes/haproxy
|
||||
var/lib/haproxy
|
||||
var/ipfire/haproxy
|
||||
@@ -51,7 +51,7 @@ $(TARGET) :
|
||||
|
||||
# Create all directories
|
||||
for i in addon-lang auth backup ca captive certs connscheduler crls ddns dhcp dhcpc dns dnsforward \
|
||||
ethernet extrahd/bin fwlogs fwhosts firewall ipblocklist key langs logging loxilb mac main \
|
||||
ethernet extrahd/bin fwlogs fwhosts firewall haproxy ipblocklist key langs logging loxilb mac main \
|
||||
menu.d modem optionsfw \
|
||||
ovpn patches pakfire portfw ppp private proxy/advanced/cre \
|
||||
proxy/calamaris/bin qos/bin red remote sensors suricata time \
|
||||
@@ -65,7 +65,7 @@ $(TARGET) :
|
||||
captive/settings captive/agb.txt captive/clients captive/voucher_out certs/index.txt certs/index.txt.attr ddns/config ddns/settings ddns/ipcache dhcp/settings \
|
||||
dhcp/fixleases dhcp/advoptions dhcp/dhcpd.conf.local dns/settings dns/servers dnsforward/config ethernet/aliases ethernet/settings ethernet/known_nics ethernet/scanned_nics \
|
||||
ethernet/wireless extrahd/scan extrahd/devices extrahd/partitions extrahd/settings firewall/settings firewall/locationblock firewall/input firewall/outgoing \
|
||||
fwhosts/customnetworks fwhosts/customhosts fwhosts/customgroups fwhosts/customservicegrp fwhosts/customlocationgrp fwlogs/ipsettings fwlogs/portsettings ipblocklist/modified \
|
||||
fwhosts/customnetworks fwhosts/customhosts fwhosts/customgroups fwhosts/customservicegrp fwhosts/customlocationgrp fwlogs/ipsettings fwlogs/portsettings ipblocklist/modified haproxy/settings \
|
||||
ipblocklist/settings loxilb/settings mac/settings main/hosts main/routing main/security main/settings optionsfw/settings \
|
||||
ovpn/ccd.conf ovpn/ccdroute ovpn/ccdroute2 pakfire/settings portfw/config ppp/settings-1 ppp/settings-2 ppp/settings-3 ppp/settings-4 \
|
||||
ppp/settings-5 ppp/settings proxy/settings proxy/squid.conf proxy/advanced/settings proxy/advanced/cre/enable remote/settings qos/settings qos/classes qos/subclasses qos/level7config qos/portconfig \
|
||||
@@ -117,6 +117,7 @@ $(TARGET) :
|
||||
cp $(DIR_SRC)/config/cfgroot/tcp_ports $(CONFIG_ROOT)/ddos/tcp_ports
|
||||
cp $(DIR_SRC)/config/cfgroot/loxilb-settings $(CONFIG_ROOT)/loxilb/settings
|
||||
cp $(DIR_SRC)/config/cfgroot/loxilb-FWconfig.txt $(CONFIG_ROOT)/loxilb/FWconfig.txt
|
||||
cp $(DIR_SRC)/config/cfgroot/haproxy-settings $(CONFIG_ROOT)/haproxy/settings
|
||||
# Oneliner configfiles
|
||||
echo "ENABLED=off" > $(CONFIG_ROOT)/vpn/settings
|
||||
echo "01" > $(CONFIG_ROOT)/certs/serial
|
||||
|
||||
@@ -96,7 +96,7 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects))
|
||||
|
||||
-mkdir -pv /etc/haproxy /var/lib/haproxy
|
||||
install -v -m 644 $(DIR_SRC)/config/haproxy/haproxy.cfg \
|
||||
/etc/haproxy/haproxy.cfg
|
||||
/var/ipfire/haproxy/haproxy.cfg
|
||||
|
||||
install -v -m 644 $(DIR_SRC)/config/backup/includes/haproxy \
|
||||
/var/ipfire/backup/addons/includes/haproxy
|
||||
|
||||
@@ -129,6 +129,7 @@ $(TARGET) :
|
||||
ln -sf ../init.d/cyrus-sasl /etc/rc.d/rc3.d/S24cyrus-sasl
|
||||
ln -sf ../init.d/sshd /etc/rc.d/rc3.d/S30sshd
|
||||
ln -sf ../init.d/apache /etc/rc.d/rc3.d/S32apache
|
||||
ln -sf ../init.d/haproxy /etc/rc.d/rc3.d/S35haproxy
|
||||
ln -sf ../init.d/fcron /etc/rc.d/rc3.d/S40fcron
|
||||
ln -sf ../../sysconfig/rc.local /etc/rc.d/rc3.d/S98rc.local
|
||||
ln -sf ../init.d/grub-btrfsd /etc/rc.d/rc3.d/S99grub-btrfsd
|
||||
|
||||
@@ -21,12 +21,15 @@
|
||||
|
||||
. /etc/sysconfig/rc
|
||||
. ${rc_functions}
|
||||
eval $(/usr/local/bin/readhash /var/ipfire/haproxy/settings)
|
||||
|
||||
case "${1}" in
|
||||
start)
|
||||
boot_mesg "Starting HAProxy..."
|
||||
loadproc /usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg \
|
||||
-p /var/run/haproxy.pid
|
||||
if [ "$ENABLE_HAPROXY" == "on" ]; then
|
||||
boot_mesg "Starting HAProxy..."
|
||||
loadproc /usr/sbin/haproxy -D -f /var/ipfire/haproxy/haproxy.cfg \
|
||||
-p /var/run/haproxy.pid
|
||||
fi
|
||||
;;
|
||||
|
||||
stop)
|
||||
@@ -36,7 +39,7 @@ case "${1}" in
|
||||
|
||||
reload)
|
||||
boot_mesg "Reloading HAProxy..."
|
||||
/usr/sbin/haproxy -D -f /etc/haproxy/haproxy.cfg \
|
||||
/usr/sbin/haproxy -D -f /var/ipfire/haproxy/haproxy.cfg \
|
||||
-p /var/run/haproxy.pid -sf $(cat /var/run/haproxy.pid)
|
||||
evaluate_retval
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user