From b36f3148561a6abf306deb69e1d5a59f900a344f Mon Sep 17 00:00:00 2001 From: Manojkiran Eda Date: Sat, 26 May 2018 10:37:52 +0530 Subject: Remove hidden-files in coredump(dir) during boot It is observed that systemd-coredump has the capability to remove the older dumps which are having the naming style mentioned in /proc/sys/kernel/core_pattern, But will not remove any other files present in the coredump directory. It can happen that, while processing a dump the BMC Crashes and there by leaving the partial dumps in the coredump directory and these will be hidden and will not be removed by systemd-coredump service.These files can get piled up and the BMC can run into OOM condition.So idea of this commit is to make sure that , we remove all the temporary hidden files in the coredump directory during the next BMC boot. - Made a rule and placed it in /usr/lib/tmpfiles.d/*.conf which will be used by systemd-tmpfiles to remove the hidden files in coredump directory during boot. Partially Resolves openbmc/openbmc#2826 (From meta-phosphor rev: 9fe03c666476de51ab75904f008f45f8485ac9b2) Change-Id: Iff96b3880ebdeccb842e6aa7ff9807fcd451fb5a Signed-off-by: manojeda Signed-off-by: Brad Bishop --- meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.bb | 8 +++++++- .../recipes-phosphor/dump/phosphor-debug-collector/coretemp.conf | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector/coretemp.conf (limited to 'meta-phosphor/recipes-phosphor') diff --git a/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.bb b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.bb index b4800645b..da3151b9c 100644 --- a/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.bb +++ b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector.bb @@ -61,7 +61,7 @@ MGR_SVC ?= "xyz.openbmc_project.Dump.Manager.service" SYSTEMD_SUBSTITUTIONS += "BMC_DUMP_PATH:${bmc_dump_path}:${MGR_SVC}" -FILES_${PN}-manager += "${sbindir}/phosphor-dump-manager" +FILES_${PN}-manager += "${sbindir}/phosphor-dump-manager ${exec_prefix}/lib/tmpfiles.d/coretemp.conf" FILES_${PN}-monitor += "${sbindir}/phosphor-dump-monitor" FILES_${PN}-dreport += "${bindir}/dreport" FILES_${PN}-scripts += "${dreport_dir}" @@ -72,6 +72,12 @@ SYSTEMD_SERVICE_${PN}-monitor += "obmc-dump-monitor.service" EXTRA_OECONF = "BMC_DUMP_PATH=${bmc_dump_path}" S = "${WORKDIR}/git" +SRC_URI += "file://coretemp.conf" + +do_install_append() { + install -d ${D}${exec_prefix}/lib/tmpfiles.d + install -m 644 ${WORKDIR}/coretemp.conf ${D}${exec_prefix}/lib/tmpfiles.d/ +} # Install dreport script # From tools/dreport.d/dreport to /usr/bin/dreport diff --git a/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector/coretemp.conf b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector/coretemp.conf new file mode 100644 index 000000000..b9a36e6de --- /dev/null +++ b/meta-phosphor/recipes-phosphor/dump/phosphor-debug-collector/coretemp.conf @@ -0,0 +1,8 @@ +# This configuration file will help in +# removing all the hidden files in the +# coredump folder at boot time. +# +# See tmpfiles.d for more details + +R! /var/lib/systemd/coredump/.[^.] - - - - +R! /var/lib/systemd/coredump/.??* - - - - -- cgit v1.2.1