1.修改配置文件,添加Maat读取全量增量目录路径

2.修改原Maat监控流程,增加对全量增量目录监控代码
3.根据安装文档修改打包程序
This commit is contained in:
fengweihao
2018-09-18 14:48:55 +08:00
parent f3f1ef6ca2
commit 80de57b199
16 changed files with 158 additions and 47 deletions

View File

@@ -21,8 +21,6 @@
struct config_bucket_t certConfig = {
.thread_nu = 1,
.expire_after = 30,
.info_path = "/home/test",
.pxy_path = "/home/test",
.def_path = "/home/test",
.addr_t = {9995, 3336, "0.0.0.0"},
};
@@ -54,21 +52,6 @@ static int load_system_config(char *config)
rte->def_path);
goto finish;
}
xret = MESA_load_profile_string_nodef(config, "CONFIG", "table_info", rte->info_path, 128);
if (xret < 0 && !rt_file_exsit(rte->info_path)){
mesa_runtime_log(RLOG_LV_FATAL, MODULE_NAME, "Read the table info failed or the (%s) does not exist",
rte->info_path);
goto finish;
}
xret = MESA_load_profile_string_nodef(config, "CONFIG", "pxy_obj_keyring", rte->pxy_path, 128);
if (xret < 0 && !rt_file_exsit(rte->pxy_path)){
mesa_runtime_log(RLOG_LV_FATAL, MODULE_NAME, "Read the pxy obj keyring failed or the (%s) does not exist",
rte->pxy_path);
goto finish;
}
finish:
return xret;
}
@@ -100,10 +83,57 @@ finish:
return xret;
}
static int load_maat_config(char *config)
{
int xret = -1;
struct ntc_maat_t *maat_t = &cert_default_config()->maat_t;
xret = MESA_load_profile_uint_nodef(config, "NTC_MAAT", "maat_json_switch", &(maat_t->maat_json_switch));
if (xret < 0){
mesa_runtime_log(RLOG_LV_FATAL, MODULE_NAME, "Reading the number of running threads failed");
}
xret = MESA_load_profile_string_nodef(config, "NTC_MAAT", "table_info", maat_t->info_path, 128);
if (xret < 0 && !rt_file_exsit( maat_t->info_path)){
mesa_runtime_log(RLOG_LV_FATAL, MODULE_NAME, "Read the table info failed or the (%s) does not exist",
maat_t->info_path);
goto finish;
}
if (maat_t->maat_json_switch == 1){
xret = MESA_load_profile_string_nodef(config, "CONFIG", "pxy_obj_keyring", maat_t->pxy_path, 128);
if (xret < 0 && !rt_file_exsit(maat_t->pxy_path)){
mesa_runtime_log(RLOG_LV_FATAL, MODULE_NAME, "Read the pxy obj keyring failed or the (%s) does not exist",
maat_t->pxy_path);
goto finish;
}
}
if (maat_t->maat_json_switch == 0){
xret = MESA_load_profile_string_nodef(config, "NTC_MAAT", "inc_cfg_dir", maat_t->inc_cfg_dir, 128);
if (xret < 0 && !rt_file_exsit( maat_t->inc_cfg_dir)){
mesa_runtime_log(RLOG_LV_FATAL, MODULE_NAME, "Read the table info failed or the (%s) does not exist",
maat_t->inc_cfg_dir);
goto finish;
}
xret = MESA_load_profile_string_nodef(config, "NTC_MAAT", "full_cfg_dir", maat_t->full_cfg_dir, 128);
if (xret < 0 && !rt_file_exsit( maat_t->full_cfg_dir)){
mesa_runtime_log(RLOG_LV_FATAL, MODULE_NAME, "Read the table info failed or the (%s) does not exist",
maat_t->full_cfg_dir);
goto finish;
}
}
finish:
return xret;
}
void cert_init_config(char *config)
{
load_system_config(config);
load_maat_config(config);
load_module_config(config);
}