]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: init: allow directory as argument of -f
authorMaxime de Roucy <maxime.deroucy@gmail.com>
Fri, 13 May 2016 21:52:56 +0000 (23:52 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 14 May 2016 05:09:33 +0000 (07:09 +0200)
commit379d9c7c14e684ab1dcdb6467a6bf189153c2b1d
tree7880acb8abf1a41f3827bc577f57716dd5417db4
parent0f503925f07b5554bf1fb3720276db1a8b317aa0
MEDIUM: init: allow directory as argument of -f

If -f argument is a directory add all the files (and only files) it
containes to the config files list.
These files are added in lexical order (respecting LC_COLLATE).
Only files with ".cfg" extension are added.
Only non hidden files (not prefixed with ".") are added.
Symlink are followed.
The -f order is still respected:

        $ tree -a rootdir
        rootdir
        |-- dir1
        |   |-- .6.cfg
        |   |-- 1.cfg
        |   |-- 2
        |   |-- 3.cfg
        |   |-- 4.cfg -> 1.cfg
        |   |-- 5 -> 1.cfg
        |   |-- 7.cfg -> .
        |   `-- dir4
        |       `-- 8.cfg
        |-- dir2
        |   |-- 10.cfg
        |   `-- 9.cfg
        |-- dir3
        |   `-- 11.cfg
        |-- link -> dir3/
        |-- root1
        |-- root2
        `-- root3

        $ ./haproxy -C rootdir -f root2 -f dir2 -f root3 -f dir1 \
                               -f link -f root1
        root2
        dir2/10.cfg
        dir2/9.cfg
        root3
        dir1/1.cfg
        dir1/3.cfg
        dir1/4.cfg
        link/11.cfg
        root1

This can be useful on systemd where you can't change the haproxy
commande line options on service reload.
doc/haproxy.1
doc/management.txt
src/haproxy.c