Re: [PATCH] Read acl included files relative to the configuration file

From: Willy Tarreau <w#1wt.eu>
Date: Thu, 8 Sep 2011 07:43:46 +0200


Hi again,

On Thu, Sep 08, 2011 at 12:34:14AM +0200, Willy Tarreau wrote:
> If there is a real need for what you describe in some environments,
> (and I'm still doubting about it), I'd rather have a new flag on the
> command line which would cause a chdir() to be issued with each loaded
> config file to its dirname when it's parsed so that *all* locations
> are relative to the config file (eg: pidfiles, unix sockets, acl and
> other files later). For instance, the '-r' flag is not used, you could
> very well use it.

This morning I had an better idea : pass the "config directory" parameter on the command line and have haproxy chdir() to it. That way, everything specified after it is relative to this dir, and you don't need a full path for config files. Eg :

    haproxy -C /etc/haproxy -f haproxy.cfg

I think it's easier to explain and to understand than previous proposal, and it can completely solve your multi-machine issue (well doing "cd" before starting haproxy also does, but I agree it can be less convenient, especially when copy-pasting a command line from "ps").

If you're interested in this feature, please either send a patch or simply tell me, I think it won't take long and I can also do it myself.

Regards,
Willy Received on 2011/09/08 07:43

This archive was generated by hypermail 2.2.0 : 2011/09/08 08:00 CEST