Bug 2076267 - sysctl --system disables abrt-hook-ccpp
Summary: sysctl --system disables abrt-hook-ccpp
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: abrt
Version: 8.1
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: abrt
QA Contact: CS System Management SST QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-04-18 13:45 UTC by Paulo Andrade
Modified: 2023-06-30 08:18 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-06-30 08:18:08 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1657158 1 high CLOSED In ABRT + systemd-coredump environment, "sysctl --system" disables abrt-hook-ccpp 2023-06-27 13:12:13 UTC
Red Hat Issue Tracker RHELPLAN-119123 0 None None None 2022-04-18 13:50:16 UTC

Description Paulo Andrade 2022-04-18 13:45:58 UTC
When configuring the system to use abrt-ccpp instead of systemd-coredump,
if running "sysctl --system", it will override kernel.core_pattern

To reproduce the issue, assuming it is using systemd-coredump, what
should be default, run:


# systemctl disable abrt-journal-core.service
# systemctl mask abrt-journal-core.service
# systemctl stop abrt-journal-core.service
# systemctl enable abrt-ccpp.service
# systemctl start abrt-ccpp.service

  After above steps, might need to run:

# systemctl daemon-reload

or reboot.

After that /proc/sys/kernel/core_pattern should show it is using
abrt-hook-ccpp.

The problem is that if running "sysctl --system" will change back to
use systemd-coredump, leaving the system in a confusing state.


It should be possible to use abrt-ccpp instead of systemd-coredump
and also be able to run "sysctl --system", without any hacking around
to save/restore /proc/sys/kernel/core_pattern

Comment 1 Michal Sekletar 2022-04-19 13:02:03 UTC
I think it should be ABRT package that will ship/create sysctl snippet that would override the default one.

Comment 2 David Tardon 2022-04-19 17:17:01 UTC
To expand comment 1 a bit: the way abrt sets up kernel.core_pattern is just incompatible with `sysctl --system`. abrt-ccpp.service changes the core_pattern on the fly, on start/stop of the service, but sysctl configuration *on disk* remains unchanged. Hence, when `sysctl --system` is run, it just reapplies that configuration, overriding the value previously written by abrt-ccpp.service. There are two simple ways to fix this: 1/ Ship a config. file for sysctl that overrides the kernel.core_pattern set by systemd's config. file (which is /usr/lib/sysctl.d/50-coredump.conf, so something like /usr/lib/sysctl.d/60-abrt.conf would do.) Then kernel.core pattern would be set to abrt just by installing abrt (or a subpackage of abrt that contains the C++ hook). 2/ Also write the core_pattern to a temporary config. file in /run/sysctl.d on start of abrt-ccpp.service (and remove the file again on stop).


Note You need to log in before you can comment on or make changes to this bug.