diff options
author | Lei YU <yulei.sh@bytedance.com> | 2020-11-23 06:05:01 +0300 |
---|---|---|
committer | Lei YU <yulei.sh@bytedance.com> | 2021-07-14 10:27:23 +0300 |
commit | 521eaaac1ce6f571037bfa32403ca5f7c02fcc90 (patch) | |
tree | 16fefed7aacd714cbeda3e25b59e593472d86c4d /meta-bytedance/recipes-core | |
parent | 13ec476263e08b950e4d51b640755b86875d4817 (diff) | |
download | openbmc-521eaaac1ce6f571037bfa32403ca5f7c02fcc90.tar.xz |
bytedance: Limit coredump size
Override coredump.conf and set the max size of coredump to 2MiB.
Tested: Verify systemd removes the old coredumps and makes sure the max
size is around 2MiB.
Signed-off-by: Lei YU <yulei.sh@bytedance.com>
Change-Id: I9ae2ba46edd2b1e1b12537f12ca09f97882a7d40
Diffstat (limited to 'meta-bytedance/recipes-core')
3 files changed, 26 insertions, 0 deletions
diff --git a/meta-bytedance/recipes-core/systemd/systemd-conf/coredump.conf b/meta-bytedance/recipes-core/systemd/systemd-conf/coredump.conf new file mode 100644 index 000000000..8c3d11274 --- /dev/null +++ b/meta-bytedance/recipes-core/systemd/systemd-conf/coredump.conf @@ -0,0 +1,8 @@ +[Coredump] +#Storage=external +#Compress=yes +#ProcessSizeMax=2G +#ExternalSizeMax=2G +#JournalSizeMax=767M +MaxUse=2M +#KeepFree= diff --git a/meta-bytedance/recipes-core/systemd/systemd-conf_%.bbappend b/meta-bytedance/recipes-core/systemd/systemd-conf_%.bbappend new file mode 100644 index 000000000..7677eee30 --- /dev/null +++ b/meta-bytedance/recipes-core/systemd/systemd-conf_%.bbappend @@ -0,0 +1,15 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_append = " \ + file://coredump.conf \ +" + +do_install_append() { + install -m 0644 \ + ${WORKDIR}/coredump.conf \ + -D -t ${D}${sysconfdir}/systemd +} + +FILES_${PN}_append = " \ + ${sysconfdir}/systemd/coredump.conf \ +" diff --git a/meta-bytedance/recipes-core/systemd/systemd_%.bbappend b/meta-bytedance/recipes-core/systemd/systemd_%.bbappend new file mode 100644 index 000000000..2bdee496b --- /dev/null +++ b/meta-bytedance/recipes-core/systemd/systemd_%.bbappend @@ -0,0 +1,3 @@ +do_install_append () { + rm ${D}${sysconfdir}/systemd/coredump.conf +} |