Skip to content

Commit

Permalink
Made cf-support use coredumpctl for core analysis only when configure…
Browse files Browse the repository at this point in the history
…d in kerenl.core_pattern

It's possible for coredumpctl to be present yet the system not correctly
configured to use systemd-coredump which results in coredumpctl not being able
to find core files. This change restricts the use of coredumpctl for when
systemd-coredump is present in sysctl kernel.core_pattern.

Ticket: ENT-9985
Changelog: Title
  • Loading branch information
nickanderson committed Oct 3, 2023
1 parent e3f612e commit 9f53845
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion misc/cf-support
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ mkdir -p "$tmpdir"

echo "Analyzing CFEngine core dumps"
_core_log="$tmpdir"/core-dump.log
if command -v coredumpctl >/dev/null; then
_sysctl_kernel_core_pattern="$(sysctl -n kernel.core_pattern)"
if expr "$_sysctl_kernel_core_pattern" : ".*/systemd-coredump.*" > /dev/null 2>&1; then
echo "Found systemd-coredump used in sysctl kernel.core_pattern \"$_sysctl_kernel_core_pattern\""
echo "Using coredumpctl to analyze CFEngine core dumps"
coredumpctl info /var/cfengine/bin/cf-* 2>/dev/null >> "$_core_log" || true
elif command -v apport-unpack >/dev/null; then
Expand Down

0 comments on commit 9f53845

Please sign in to comment.