#1002734 haproxy init.d exits when CONFIG is a valid directory

Package:
haproxy
Source:
haproxy
Description:
fast and reliable load balancing reverse proxy
Submitter:
Geof Bosworth
Date:
2021-12-28 14:33:03 UTC
Severity:
minor
#1002734#5
Date:
2021-12-28 14:23:21 UTC
From:
To:
Dear Maintainer,

/etc/init.d/haproxy checks for existence of $CONFIG file, and exits if $CONFIG file does not exist.

Man page for haproxy states:

       -f <configuration file|dir>
              Specify configuration file or directory path. If the argument is a directory the files (and only files) it contains are added in lexical order (using LC_COLLATE=C) ; only non hidden
              files with ".cfg" extension are added.

Setting CONFIG to a directory in /etc/default/haproxy causes /etc/init.d/haproxy to exit, due to:

test -f "$CONFIG" || exit 0

One way to allow haproxy to run with CONFIG as directory:

test -f "$CONFIG" || test -d "$CONFIG" || exit 0

I've checked later version and same problem exists in Package: haproxy Version: 2.4.10-1

regards,
Geof