Store persisted config directory

The persisted configuration subdirectory will be used to store changes to
the configuration. The gwdirs.h header now supports setting and getting
the value for this directory.
This commit is contained in:
Markus Makela
2016-11-10 10:35:10 +02:00
parent 4b82f83637
commit ec894f41b8
4 changed files with 30 additions and 1 deletions

View File

@ -65,6 +65,7 @@
#include <maxscale/service.h>
#include <maxscale/spinlock.h>
#include <maxscale/utils.h>
#include <maxscale/gwdirs.h>
typedef struct duplicate_context
{

View File

@ -26,6 +26,17 @@ void set_configdir(char* str)
configdir = str;
}
/**
* Set the configuration parts file directory
* @param str Path to directory
*/
void set_config_persistdir(char* str)
{
MXS_FREE(config_persistdir);
clean_up_pathname(str);
config_persistdir = str;
}
/**
* Set the log file directory
* @param str Path to directory
@ -160,6 +171,15 @@ char* get_configdir()
return configdir ? configdir : (char*) default_configdir;
}
/**
* Get the configuration file directory
* @return The path to the configuration file directory
*/
char* get_config_persistdir()
{
return config_persistdir ? config_persistdir : (char*) default_config_persistdir;
}
/**
* Get the PID file directory which contains maxscale.pid
* @return Path to the PID file directory