From 962a63310f60661dbf2b7a380e5f8e6e256a9712 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Thu, 7 Oct 2021 23:40:08 +0200 Subject: [PATCH] net/haproxy: deploy haproxy.conf if it does not exist, fixes #2474 --- net/haproxy/pkg-descr | 6 ++++++ net/haproxy/src/etc/rc.syshook.d/start/50-haproxy | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100755 net/haproxy/src/etc/rc.syshook.d/start/50-haproxy diff --git a/net/haproxy/pkg-descr b/net/haproxy/pkg-descr index c4e4ba901..0b23647bf 100644 --- a/net/haproxy/pkg-descr +++ b/net/haproxy/pkg-descr @@ -11,6 +11,12 @@ Plugin Changelog Added: * add support for advanced resolver properties (#2330) +Fixed: +* no haproxy.conf after restoring a config backup (#2474) + +Changed: +* deploy haproxy.conf if it does not exist (#2474) + 3.5 Fixed: diff --git a/net/haproxy/src/etc/rc.syshook.d/start/50-haproxy b/net/haproxy/src/etc/rc.syshook.d/start/50-haproxy new file mode 100755 index 000000000..09c0e0ef1 --- /dev/null +++ b/net/haproxy/src/etc/rc.syshook.d/start/50-haproxy @@ -0,0 +1,7 @@ +#!/bin/sh + +# fallback if no config file exists (i.e. after config backup restore) +if [ ! -e /usr/local/etc/haproxy.conf -a -e /usr/local/etc/haproxy.conf.staging ]; then + cp /usr/local/etc/haproxy.conf.staging /usr/local/etc/haproxy.conf + /usr/local/etc/rc.d/haproxy start +fi