Enable core dump on Debian
Install
1 | apt-get install -yqq systemd-coredump |
Configure
1 | vim /etc/security/limits.conf |
Core pattern
1 | cat /proc/sys/kernel/core_pattern |
if kernel.core_pattern
starts with then runs program, eg. kernel.core_pattern='/bin/false'
Shortcut
Description
%%
output one ‘%’
%p
pid
%P
global pid (init PID namespace)
%i
tid
%I
global tid (init PID namespace)
%u
uid (in initial user namespace)
%g
gid (in initial user namespace)
%d
Dump mode, matches PR_SET_DUMPABLE and /proc/sys/fs/suid_dumpable
%s
Signal number
%t
UNIX time of dump
%h
hostname
%e
executable filename (may be shortened)
%E
executable path
Configuration
1 | $ echo 'ulimit -S -c 0' >> ~/.bash_profile |
To disable
1 | $ cat /etc/systemd/coredump.conf.d/custom.conf |
Reload configuration
1 | systemctl daemon-reload |
Test
1 | sleep 500 & |
or
1 | ulimit -S -c unlimited sleep 500 & |
Recommendations
Recommendations