Merge branch '2.2' into develop

This commit is contained in:
Markus Mäkelä
2018-05-25 12:15:58 +03:00
3 changed files with 16 additions and 4 deletions

View File

@ -123,7 +123,8 @@ form.
### Global Settings
The global settings, in a section named `[MaxScale]`, allow various parameters
that affect MariaDB MaxScale as a whole to be tuned.
that affect MariaDB MaxScale as a whole to be tuned. This section must be
defined in the root configuration file which by default is `/etc/maxscale.cnf`.
#### `threads`

View File

@ -642,8 +642,8 @@ void TestConnections::init_maxscale(int m)
"chmod a+x %s;"
"%s"
"iptables -F INPUT;"
"truncate -s 0 %s/maxscale.log;"
"truncate -s 0 %s/maxscale1.log;"
"rm -f %s/maxscale.log;"
"rm -f %s/maxscale1.log;"
"rm -rf /tmp/core* /dev/shm/* /var/lib/maxscale/maxscale.cnf.d/ /var/lib/maxscale/*;"
"%s",
maxscales->access_homedir[m],

View File

@ -523,6 +523,8 @@ static bool is_empty_string(const char* str)
return true;
}
static bool is_root_config_file = true;
/**
* Config item handler for the ini file reader
*
@ -572,9 +574,17 @@ static int ini_handler(void *userdata, const char *section, const char *name, co
}
if (strcmp(section, CN_GATEWAY) == 0 || strcasecmp(section, CN_MAXSCALE) == 0)
{
if (is_root_config_file)
{
return handle_global_item(name, value);
}
else
{
MXS_ERROR("The [maxscale] section must only be defined in the root configuration file.");
return 0;
}
}
else if (strlen(section) == 0)
{
MXS_ERROR("Parameter '%s=%s' declared outside a section.", name, value);
@ -899,6 +909,7 @@ config_load_and_process(const char* filename, bool (*process_config)(CONFIG_CONT
if (config_load_single_file(filename, &dcontext, &ccontext))
{
is_root_config_file = false;
const char DIR_SUFFIX[] = ".d";
char dir[strlen(filename) + sizeof(DIR_SUFFIX)];