On Sun, Mar 12, 2017 at 11:24:45AM +0000, Jeremy Harris wrote:
> With the 555 calls of macro_create() it does seem that the
> builtin macros are being activated. The place that happens
> is probably the call to macros_create_builtin() in
> get_config_line() - about line 1029 of readconf.c in
> master HEAD. There's a commented-out printf on the line
> before; please uncomment that and run that build
> (normal debug facilities don't work this early in Exim's
> startup, unfortunately).
>
> We should discover what the trigger is.
> --
> Cheers,
> Jeremy
This loop appears to be the problem.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if (!macros_builtin_created)
{
const uschar * t, * p;
uschar c;
for (t = s; (p = CUstrchr(t, '_')); t = p+1)
if (c = p[1], c == 'O' || c == 'D' || c == 'H')
{
fprintf(stderr, "%s: builtins create triggered by '%s'\n", __FUNCTION__, s);
macros_create_builtin();
break;
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It triggers when a macro name contains the sequence /_[ODH]/.
Example from my exim.conf file:
EXIM_ROOT = /opt/exim
CFG_DIR = EXIM_ROOT/etc
ALIASES = CFG_DIR/db/aliases.dbmnz
RELAY_TO_DOMAINS = CFG_DIR/db/relay_to_domains.dbmnz
ROUTE_DATA = CFG_DIR/db/route_data.dbmnz
RELAY_4_HOSTS = CFG_DIR/relay_4_hosts
...
...
get_config_line: builtins create triggered by '= CFG_DIR/db/aliases.dbmnz
'
Additionally the loop is executing inside comments though I wouldn't
expect that.
When I removed the '_' from the definitions above and reran I get the
following:
get_config_line: builtins create triggered by '# LOCAL_DOMAINS, +relay_to_domains, and +relay_from_hosts, respectively. They
'
This is found in a comment block:
# The next three settings create two lists of domains and one list of hosts.
# These lists are referred to later in this configuration using the syntax
# LOCAL_DOMAINS, +relay_to_domains, and +relay_from_hosts, respectively. They
# are all colon-separated lists:
You are also correct in that when macros_create_builtin() is not
called the startup time is greatly reduced.
Wayne