diff options
author | Unsung Lee <unsung.lee@samsung.com> | 2024-10-24 14:52:06 +0900 |
---|---|---|
committer | Unsung Lee <unsung.lee@samsung.com> | 2024-10-24 17:16:15 +0900 |
commit | e719451afaf0f56ed2c531515080f99957d8ebb2 (patch) | |
tree | f91eaf9fcde7ccfa904844e55131d3ddc3796281 | |
parent | bea1d0df73a12cf1226e09f3072b6d637aff3f27 (diff) | |
download | resourced-tizen_dev.tar.gz resourced-tizen_dev.tar.bz2 resourced-tizen_dev.zip |
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.c | 7 | ||||
-rw-r--r-- | src/common/conf/config-parser.h | 2 |
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) |