From: Unsung Lee Date: Wed, 12 Jan 2022 11:18:57 +0000 (+0900) Subject: Modify configuration file name/path X-Git-Tag: submit/tizen/20220425.104329~27 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7471d6a67cc82f1295c337e28b8d2564ad75fc49;p=platform%2Fcore%2Fsystem%2Fresourced.git Modify configuration file name/path Change-Id: I3b84a0961d379e127025762ee6b2a705ad14d031 Signed-off-by: Unsung Lee --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b2cc84..0c30bd5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ SET(CMAKELISTS_DIR ${CMAKE_SOURCE_DIR}/CMakeLis SET(INCLUDE_COMMON_DIR ${CMAKE_SOURCE_DIR}/src/common) SET(INCLUDE_CGROUP_DIR ${CMAKE_SOURCE_DIR}/src/common/cgroup) SET(INCLUDE_PUBLIC_DIR ${CMAKE_SOURCE_DIR}/include) +SET(CONF_DIR ${CMAKE_SOURCE_DIR}/conf) SET(RESOURCED_INCLUDEDIR ${INCLUDE_COMMON_DIR} ${INCLUDE_CGROUP_DIR} ${INCLUDE_PUBLIC_DIR}) #misc @@ -81,7 +82,7 @@ SET(WATCHDOG_SOURCE_DIR ${PROCESS_SOURCE_DIR}/watchd SET(PRIORITY_SOURCE_DIR ${PROCESS_SOURCE_DIR}/priority) -INSTALL(FILES ${CMAKE_SOURCE_DIR}/resourced.conf DESTINATION /etc/dbus-1/system.d) +INSTALL(FILES ${CONF_DIR}/org.tizen.resourced.conf DESTINATION /etc/dbus-1/system.d) ADD_SUBDIRECTORY(src) IF(DEFINED RD_TESTS_PATH) diff --git a/src/process/block/block.conf b/conf/block.conf similarity index 100% rename from src/process/block/block.conf rename to conf/block.conf diff --git a/src/resource-limiter/cpu/cpu-sched.conf b/conf/cpu-sched.conf similarity index 100% rename from src/resource-limiter/cpu/cpu-sched.conf rename to conf/cpu-sched.conf diff --git a/src/resource-limiter/cpu/cpu.conf b/conf/cpu.conf similarity index 100% rename from src/resource-limiter/cpu/cpu.conf rename to conf/cpu.conf diff --git a/src/resource-optimizer/memory/dedup/dedup.conf b/conf/dedup.conf similarity index 100% rename from src/resource-optimizer/memory/dedup/dedup.conf rename to conf/dedup.conf diff --git a/src/resource-monitor/heart.conf b/conf/heart.conf similarity index 100% rename from src/resource-monitor/heart.conf rename to conf/heart.conf diff --git a/src/resource-limiter/memory/memory.conf b/conf/memory-profile-iot-headless.conf similarity index 100% rename from src/resource-limiter/memory/memory.conf rename to conf/memory-profile-iot-headless.conf diff --git a/src/resource-limiter/memory/memory-tv.conf b/conf/memory-profile-tv.conf similarity index 100% rename from src/resource-limiter/memory/memory-tv.conf rename to conf/memory-profile-tv.conf diff --git a/src/resource-limiter/memory/memory-iot-headless.conf b/conf/memory.conf similarity index 100% rename from src/resource-limiter/memory/memory-iot-headless.conf rename to conf/memory.conf diff --git a/resourced.conf b/conf/org.tizen.resourced.conf similarity index 100% rename from resourced.conf rename to conf/org.tizen.resourced.conf diff --git a/src/process/proc.conf b/conf/process.conf similarity index 100% rename from src/process/proc.conf rename to conf/process.conf diff --git a/src/resource-optimizer/memory/swap/swap.conf b/conf/swap.conf similarity index 100% rename from src/resource-optimizer/memory/swap/swap.conf rename to conf/swap.conf diff --git a/packaging/resourced.spec b/packaging/resourced.spec index 893cff9..c590009 100644 --- a/packaging/resourced.spec +++ b/packaging/resourced.spec @@ -157,7 +157,7 @@ mkdir -p %{buildroot}/%{confdir}/configs # https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#ordering # List of configuration files provided by this package - update when any new config file is added! -%define config_files block cpu cpu-sched heart memory proc swap dedup +%define config_files block cpu cpu-sched heart memory process swap dedup for i in %{confdir}/*.conf; do if [ "$i" = %{confdir}/"*.conf" ]; then @@ -188,19 +188,19 @@ if [ $1 -eq 0 ]; then fi %post config-tv -%{_sbindir}/update-alternatives --install %{confdir}/memory.conf resourced-config-memory %{confdir}/configs/config-memory-tv.conf 150 +%{_sbindir}/update-alternatives --install %{confdir}/memory.conf resourced-config-memory %{confdir}/configs/config-memory-profile-tv.conf 150 %preun config-tv if [ $1 -eq 0 ]; then - %{_sbindir}/update-alternatives --remove resourced-config-memory %{confdir}/configs/config-memory-tv.conf + %{_sbindir}/update-alternatives --remove resourced-config-memory %{confdir}/configs/config-memory-profile-tv.conf fi %post config-iot-headless -%{_sbindir}/update-alternatives --install %{confdir}/memory.conf resourced-config-memory %{confdir}/configs/config-memory-iot-headless.conf 150 +%{_sbindir}/update-alternatives --install %{confdir}/memory.conf resourced-config-memory %{confdir}/configs/config-memory-profile-iot-headless.conf 150 %preun config-iot-headless if [ $1 -eq 0 ]; then - %{_sbindir}/update-alternatives --remove resourced-config-memory %{confdir}/configs/config-memory-iot-headless.conf + %{_sbindir}/update-alternatives --remove resourced-config-memory %{confdir}/configs/config-memory-profile-iot-headless.conf fi %files @@ -222,11 +222,11 @@ fi %attr(700, root, root) %{TZ_SYS_ETC}/dump.d/module.d/dump_heart_data.sh %files config -%config %{_sysconfdir}/dbus-1/system.d/resourced.conf +%config %{_sysconfdir}/dbus-1/system.d/org.tizen.resourced.conf %{_unitdir}/resourced.service %{_unitdir}/multi-user.target.wants/resourced.service %{confdir}/configs/config-memory.conf -%{confdir}/configs/config-proc.conf +%{confdir}/configs/config-process.conf %{confdir}/configs/config-swap.conf %{confdir}/configs/config-dedup.conf %{confdir}/configs/config-block.conf @@ -236,11 +236,11 @@ fi %files config-tv %manifest resourced.manifest -%{confdir}/configs/config-memory-tv.conf +%{confdir}/configs/config-memory-profile-tv.conf %files config-iot-headless %manifest resourced.manifest -%{confdir}/configs/config-memory-iot-headless.conf +%{confdir}/configs/config-memory-profile-iot-headless.conf %if %{?vip_agent_module} == ON %files vip-release-agent diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4fe2721..2ab2da7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -133,7 +133,7 @@ ADD_LIBRARY(block MODULE ${BLOCK_SOURCE_DIR}/block-monitor.c) TARGET_LINK_LIBRARIES(block resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS}) INSTALL(TARGETS block DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH}) -INSTALL(FILES ${BLOCK_SOURCE_DIR}/block.conf DESTINATION ${RD_CONFIG_PATH}) +INSTALL(FILES ${CONF_DIR}/block.conf DESTINATION ${RD_CONFIG_PATH}) ADD_DEFINITIONS("-DFREEZER_DIR=\"${LIB_INSTALL_DIR}\"") ADD_LIBRARY(freezer MODULE ${FREEZER_SOURCE_DIR}/freezer.c) @@ -147,13 +147,13 @@ ADD_LIBRARY(swap MODULE ${SWAP_SOURCE_DIR}/zramswap.c) TARGET_LINK_LIBRARIES(swap resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS}) INSTALL(TARGETS swap DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH}) -INSTALL(FILES ${SWAP_SOURCE_DIR}/swap.conf DESTINATION ${RD_CONFIG_PATH}) +INSTALL(FILES ${CONF_DIR}/swap.conf DESTINATION ${RD_CONFIG_PATH}) ADD_LIBRARY(dedup MODULE ${DEDUP_SOURCE_DIR}/dedup.c) TARGET_LINK_LIBRARIES(dedup resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS}) INSTALL(TARGETS dedup DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH}) -INSTALL(FILES ${DEDUP_SOURCE_DIR}/dedup.conf DESTINATION ${RD_CONFIG_PATH}) +INSTALL(FILES ${CONF_DIR}/dedup.conf DESTINATION ${RD_CONFIG_PATH}) ADD_LIBRARY(heart MODULE ${RESOURCE_MONITOR_SOURCE_DIR}/heart.c @@ -166,7 +166,7 @@ ADD_LIBRARY(heart MODULE ${RESOURCE_MONITOR_SOURCE_DIR}/logging.c) TARGET_LINK_LIBRARIES(heart resourced-private-api ${RESOURCED_REQUIRE_PKGS_LDFLAGS}) INSTALL(TARGETS heart DESTINATION ${MAKE_INSTALL_PREFIX}${RD_PLUGIN_PATH}) -INSTALL(FILES ${RESOURCE_MONITOR_SOURCE_DIR}/heart.conf DESTINATION ${RD_CONFIG_PATH}) +INSTALL(FILES ${CONF_DIR}/heart.conf DESTINATION ${RD_CONFIG_PATH}) CONFIGURE_FILE(${RESOURCE_MONITOR_SOURCE_DIR}/dump_heart_data.sh.in ${RESOURCE_MONITOR_SOURCE_DIR}/dump_heart_data.sh @ONLY) INSTALL(FILES ${RESOURCE_MONITOR_SOURCE_DIR}/dump_heart_data.sh DESTINATION ${RD_SYS_ETC}/dump.d/module.d) @@ -219,15 +219,15 @@ INSTALL(TARGETS ${RD_BINARY_NAME} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE WORLD_EXECUTE) IF("${MEMORY_MODULE}" STREQUAL "ON") - INSTALL(FILES ${MEMORY_LIMITER_SOURCE_DIR}/memory.conf DESTINATION ${RD_CONFIG_PATH}) - INSTALL(FILES ${MEMORY_LIMITER_SOURCE_DIR}/memory-tv.conf DESTINATION ${RD_CONFIG_PATH}) - INSTALL(FILES ${MEMORY_LIMITER_SOURCE_DIR}/memory-iot-headless.conf DESTINATION ${RD_CONFIG_PATH}) + INSTALL(FILES ${CONF_DIR}/memory.conf DESTINATION ${RD_CONFIG_PATH}) + INSTALL(FILES ${CONF_DIR}/memory-profile-tv.conf DESTINATION ${RD_CONFIG_PATH}) + INSTALL(FILES ${CONF_DIR}/memory-profile-iot-headless.conf DESTINATION ${RD_CONFIG_PATH}) ENDIF() IF("${CPU_MODULE}" STREQUAL "ON") - INSTALL(FILES ${CPU_LIMITER_SOURCE_DIR}/cpu.conf + INSTALL(FILES ${CONF_DIR}/cpu.conf DESTINATION ${RD_CONFIG_PATH} RENAME cpu.conf) - INSTALL(FILES ${CPU_LIMITER_SOURCE_DIR}/cpu-sched.conf + INSTALL(FILES ${CONF_DIR}/cpu-sched.conf DESTINATION ${RD_CONFIG_PATH} RENAME cpu-sched.conf) ENDIF() @@ -239,5 +239,5 @@ IF("${VIP_AGENT}" STREQUAL "ON") INSTALL(TARGETS vip-release-agent DESTINATION bin) ENDIF() -INSTALL(FILES ${PROCESS_SOURCE_DIR}/proc.conf - DESTINATION ${RD_CONFIG_PATH} RENAME proc.conf) +INSTALL(FILES ${CONF_DIR}/process.conf + DESTINATION ${RD_CONFIG_PATH} RENAME process.conf) diff --git a/src/process/priority/proc-priority.c b/src/process/priority/proc-priority.c index 728bf92..1211837 100644 --- a/src/process/priority/proc-priority.c +++ b/src/process/priority/proc-priority.c @@ -36,7 +36,7 @@ #include "resourced.h" #include "trace.h" -#define PRIORITY_CONF_FILE RD_CONFIG_FILE(proc) +#define PRIORITY_CONF_FILE RD_CONFIG_FILE(process) #define FIXED_OOM_CONF_SECTION "OOM_FIXED_APPS" diff --git a/src/process/proc-appusage.c b/src/process/proc-appusage.c index 50da8ef..25f1b5d 100644 --- a/src/process/proc-appusage.c +++ b/src/process/proc-appusage.c @@ -37,7 +37,7 @@ #include "heart-common.h" #define UPDATE_INTERVAL DAY_TO_SEC(2) -#define APPUSAGE_CONF_FILE RD_CONFIG_FILE(proc) +#define APPUSAGE_CONF_FILE RD_CONFIG_FILE(process) #define APPUSAGE_CONF_SECTION "APPUSAGE" static int favorite_count; diff --git a/src/process/proc-main.c b/src/process/proc-main.c index 6121d52..832224e 100644 --- a/src/process/proc-main.c +++ b/src/process/proc-main.c @@ -60,7 +60,7 @@ #endif #endif -#define WATCHDOG_EXCLUDE_CONF_FILE RD_CONFIG_FILE(proc) +#define WATCHDOG_EXCLUDE_CONF_FILE RD_CONFIG_FILE(process) #define WATCHDOG_EXCLUDE_CONF_SECTION "WATCHDOG_EXCLUDED_PROCESSES" static GHashTable *watchdog_exclude_list; diff --git a/src/resource-limiter/cpu/cpu.c b/src/resource-limiter/cpu/cpu.c index 9ae15fb..c39a8bf 100644 --- a/src/resource-limiter/cpu/cpu.c +++ b/src/resource-limiter/cpu/cpu.c @@ -84,7 +84,7 @@ enum { enum cpu_control_type { SET_NONE, - SET_DEFAUT, + SET_DEFAULT, SET_BOOTING, SET_WRT, SET_LAZY, @@ -182,7 +182,7 @@ static int load_cpu_config(struct parse_result *result, void *user_data) if (pid > 0) { cpu_move_cgroup(pid, CPUCG_MEDIUM_GROUP_PATH); def_list.control[def_list.num].pid = pid; - def_list.control[def_list.num++].type = SET_DEFAUT; + def_list.control[def_list.num++].type = SET_DEFAULT; } else { _E("not found appname = %s", result->value); } @@ -268,7 +268,7 @@ static int cpu_foreground_state(void *data) pri = getpriority(PRIO_PROCESS, ps->pid); if (pri == -1 || pri > CPU_DEFAULT_PRI) setpriority(PRIO_PGRP, ps->pid, CPU_DEFAULT_PRI); - if (check_predefined(ps->pid) != SET_DEFAUT) + if (check_predefined(ps->pid) != SET_DEFAULT) cpu_move_cgroup_foreach(ps->pid, ps->pai, CPUCG_HIGH_GROUP_PATH); return RESOURCED_ERROR_NONE; } @@ -358,7 +358,7 @@ static int cpu_terminatestart_state(void *data) static int cpu_exclude_state(void *data) { struct proc_exclude *pe = (struct proc_exclude *)data; - if (check_predefined(pe->pid) == SET_DEFAUT) + if (check_predefined(pe->pid) == SET_DEFAULT) return RESOURCED_ERROR_NONE; if (pe->type == PROC_INCLUDE) cpu_move_cgroup(pe->pid, CPUCG_MEDIUM_GROUP_PATH);