MXS-3345: Create persistdir earlier
The directory was created when the configuration was being processed and it wasn't checked unless it was configured to a non-default value. With the addition of the path validation, the directory must be created earlier.
This commit is contained in:
@ -1810,10 +1810,7 @@ int main(int argc, char** argv)
|
||||
break;
|
||||
|
||||
case '?':
|
||||
if (check_paths())
|
||||
{
|
||||
usage();
|
||||
}
|
||||
usage();
|
||||
rc = EXIT_SUCCESS;
|
||||
goto return_main;
|
||||
|
||||
@ -2047,6 +2044,11 @@ int main(int argc, char** argv)
|
||||
goto return_main;
|
||||
}
|
||||
|
||||
// Try to create the persisted configuration directory. This needs to be done before the path validation
|
||||
// done by check_paths() to prevent it from failing. The directory wont' exist if it's the first time
|
||||
// MaxScale is starting up with this configuration.
|
||||
mxs_mkdir_all(get_config_persistdir(), S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH);
|
||||
|
||||
if (!check_paths())
|
||||
{
|
||||
rc = MAXSCALE_BADCONFIG;
|
||||
|
Reference in New Issue
Block a user