Comment 2 for bug 1972135

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to utilities (master)

Reviewed: https://review.opendev.org/c/starlingx/utilities/+/841090
Committed: https://opendev.org/starlingx/utilities/commit/7d71d83678c58dcff63e6f02ce67647b67cbd3ab
Submitter: "Zuul (22348)"
Branch: master

commit 7d71d83678c58dcff63e6f02ce67647b67cbd3ab
Author: Jiping Ma <email address hidden>
Date: Sun May 8 18:04:12 2022 -0700

    Debian: Fix the issue coredump files can not be generated.

    Compares with v219 systemd(CentOS use this one), v247 systemd
    adds the parameter META_ARGV_HOSTNAME as the upstream commit:
    https://github.com/systemd/systemd/commit/f45b8015513d38ee5f7cc361db9c5b88c9aae704
    which was integrated in the v238 systemd that need be 7 arguments.
    But they are 6 arguments in our old config file, so there prints
    out the error information in kernel dmesg that caused coredump
    file can not be generated.

    systemd-coredump[1496]: Not enough arguments passed by the kernel
    (6, expected 7).

    This commit adds coredump-sysctl-debian.conf for debian that adds
    parameters as the code in src/coredump/coredump.c.
    https://github.com/systemd/systemd/blob/main/src/coredump/coredump.c.

    META_ARGV_PID, /* %P: as seen in the initial pid namespace */
    META_ARGV_UID, /* %u: as seen in the initial user namespace */
    META_ARGV_GID, /* %g: as seen in the initial user namespace */
    META_ARGV_SIGNAL, /* %s: number of signal causing dump */
    META_ARGV_TIMESTAMP, /* %t: time of dump, expressed as
    seconds since the Epoch (we expand this to µs granularity) */
    META_ARGV_RLIMIT, /* %c: core file size soft resource limit */
    META_ARGV_HOSTNAME,/* %h: hostname */
    _META_ARGV_MAX,

    The coredump-sysctl-debian.conf also includes default settings for
    enabling coredumps by default, as expected by StarlingX.

    Test Plan:
    PASS: Build debian ISO and boot up with qemu.
    PASS: Generate the coredump file after the fix.
       1. sleep 10 &
       2. killall -SIGSEGV sleep
       3. ls /var/lib/systemd/coredump/
        core.sleep.1878.df5133eec12a4ee2a158237c7b5b41a8.1746.1653040470000000.zst

    PASS: Build CentOS ISO and boot up in the lab.
    PASS: Generate the coredump file.

    Closes-bug: 1972135

    Signed-off-by: Jiping Ma <email address hidden>
    Change-Id: I5c9a4d820430d6cad51636cd94b3363fadef4748