Skip to content

Commit

Permalink
Merge pull request #5225 from nickanderson/ENT-9985/master
Browse files Browse the repository at this point in the history
ENT-9985: Made cf-support use coredumpctl for core analysis only when configured in kerenl.core_pattern
  • Loading branch information
nickanderson authored Oct 3, 2023
2 parents e3f612e + 9f53845 commit 85d28ad
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 85d28ad

Please sign in to comment.