summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnsung Lee <unsung.lee@samsung.com>2024-10-24 14:52:06 +0900
committerUnsung Lee <unsung.lee@samsung.com>2024-10-24 17:16:15 +0900
commite719451afaf0f56ed2c531515080f99957d8ebb2 (patch)
treef91eaf9fcde7ccfa904844e55131d3ddc3796281
parentbea1d0df73a12cf1226e09f3072b6d637aff3f27 (diff)
downloadresourced-tizen_dev.tar.gz
resourced-tizen_dev.tar.bz2
resourced-tizen_dev.zip
config-parser: Support limiter.conf in limiter.conf.dtizen_devtizen
Support limiter.conf configuration file in limiter.conf.d directory. Previously, resourced supported only one limiter.conf file included in the project. Now it has been changed so that each user can replace it with their own limiter.conf file. Example: /etc/resourced/limiter.conf -> it will be not used for limiter moudle. /etc/resourced/limiter.conf.d/limiter.conf -> It will be used for limiter Change-Id: I04ff9b332ee20187ab6fc87de7d26c4a3274bc07 Signed-off-by: Unsung Lee <unsung.lee@samsung.com>
-rw-r--r--src/common/conf/config-parser.c7
-rw-r--r--src/common/conf/config-parser.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/common/conf/config-parser.c b/src/common/conf/config-parser.c
index ab841391..07c71dcb 100644
--- a/src/common/conf/config-parser.c
+++ b/src/common/conf/config-parser.c
@@ -1220,8 +1220,11 @@ void resourced_parse_vendor_configs(void)
fixed_app_and_service_list_init();
- /* Load configurations in limiter.conf and limiter.conf.d/ */
- config_parse(LIMITER_CONF_FILE, limiter_config, NULL);
+ if (access(LIMITER_CONF_DIR_LIMITER_CONF, F_OK) != 0)
+ config_parse(LIMITER_CONF_FILE, limiter_config, NULL);
+ else
+ config_parse(LIMITER_CONF_DIR_LIMITER_CONF, limiter_config, NULL);
+
config_type = LIMITER_CONFIG;
load_per_vendor_configs(LIMITER_CONF_DIR, vendor_config, &config_type);
diff --git a/src/common/conf/config-parser.h b/src/common/conf/config-parser.h
index f7c32490..6e2533f6 100644
--- a/src/common/conf/config-parser.h
+++ b/src/common/conf/config-parser.h
@@ -30,6 +30,8 @@ extern "C" {
#define CONF_FILE_SUFFIX ".conf"
+#define LIMITER_CONF_DIR_LIMITER_CONF LIMITER_CONF_DIR "/limiter.conf"
+
#define LIMITER_CONF_FILE RD_CONFIG_FILE(limiter)
#define OPTIMIZER_CONF_FILE RD_CONFIG_FILE(optimizer)
#define PROCESS_CONF_FILE RD_CONFIG_FILE(process)