reading extra config
dormando at rydia.net
Wed Jan 23 21:56:16 UTC 2008
Actually I like the idea of having something similar to apache's Include
directive. If you give it a directory or a glob it'll search through
that. I'd prefer this to a magic directory since it's easier to
document, and makes the whole thing optional.
Uhh. Not saying I'd reject the patch (it's not my call; other people are
doing the merge jobs on perlbal). Just saying I'd "like to see this if
someone made it exist" :)
Ryan Woodrum wrote:
> I've recently developed a need to segment some of the perlbal config into
> smaller pieces. I have multiple applications using perlbal with a
> centralized configuration mechanism which dynamically generates the perlbal
> config. This worked until I needed to implement multiple applications on a
> single host and suddenly manipulating the single perlbal config file became
> The solution for me was to modify perlbal very slightly to not only read in
> the default configuration file, but also to process files from an extra
> config directory.
> In the default case, this means that /etc/perlbal/perlbal.conf is read, but
> also all files under /etc/perlbal/conf.d/. In the case where a configuration
> override is given via arguments such as --config=/foo/bar/baz.conf, baz.conf
> would be used as would anything in /foo/bar/conf.d/ (if it exists). This
> allows you to segment portions of config out such as, in my case, creation of
> a pool, creation of a service, and enabling of the service. Any extra config
> in the conf.d/ directory is executed in the CommandContext of the "main"
> config file.
> I didn't want to reinvent the wheel parsing pathnames and I didn't want to
> change the function signature of load_config, so unfortunately a dependency
> on the File::Basename module is introduced and used in load_config. This
> could be worked around relatively easily, however.
> A patch is attached to this email against the 1.60 offering of Perlbal.pm on
> Thought I would pass this along.
> -ryan woodrum
More information about the perlbal