rhkdump / kdump-utils

Kernel crash dump collection utilities
GNU General Public License v2.0
3 stars 8 forks source link

dracut-module-setup: Fix missing systemd/system.conf error #1

Closed prudo1 closed 3 months ago

prudo1 commented 3 months ago

There is a bug report for RHEL10 about a grep error reading

grep: /var/tmp/dracut.DiZuKp/initramfs/etc/systemd/system.conf*: No such file or directory

that shows up when rebuilding the initrd. This is caused by systemd v255 that allows installing the default systemd config files to /usr/lib/systemd instead of /etc/systemd [1][2] which is done for RHEL. So unless a user manually adds /etc/systemd/system.conf the file no longer exists.

However the test that requires the call to grep is somewhat wonky. IIUC the test is there so we don't overwrite a setting the user might have made. In my opinion this only makes sense as long as the timeout set is larger than what we would set. But this part of the logic is missing. So fix the error message by removing the test and add our config unconditionally.

While at it rename the created drop-ins to 99-kdump.conf to follow the recommended naming convention and to make sure that our value takes precedence.

Note: In case the test is still needed we can fall back to use 'systemd-analyse cat-config' that automatically considers all potential locations for the config and its drop-ins.

[1] 6495361c7d ("meson: add build option for install path of main config files") [2] 6378f257e7 ("various: use new config loader instead of config_parse_config_file()")