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-31 15:08:41 +0900
commit48575b71de4c42563c29e7f1226a665d8a4a6338 (patch)
treeef07409d4c41d62dd614641d2b873d1242f4a5b1
parentb11beb80bd733b0a9cabd261191aa0088fb66466 (diff)
downloadresourced-tizen_9.0.tar.gz
resourced-tizen_9.0.tar.bz2
resourced-tizen_9.0.zip
config-parser: Support limiter.conf in limiter.conf.daccepted/tizen/9.0/unified/20241109.042001tizen_9.0accepted/tizen_9.0_unified
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)