Configure linux to create core dumps on a crash
2 min
Open SSH connection using PuTTy and running the following commands:
- Create the target directory first:
sudo mkdir -p /zixi/cores
# the path in core_pattern must exist, or no core file is written- sudo nano /etc/security/limits.conf
- edit row with "* soft core unlimited"
- add line sysctl kernel.core_pattern="/zixi/cores/core.%p"
- Save changes Ctrl + O
- Exit from nano Ctrl + X
- Check with the following command: ulimit -c
- Check if it is unlimited after restart as well cat /proc/sys/kernel/core_pattern
edit /etc/security/limits.conf - will make the core dumps creation persistent
sysctl kernel.core_pattern="/zixi/cores/core.%p" - will put the cores in the defined location
The limits config is not persistent across reboots. To persist this config add
kernel.core_pattern = /zixi/cores/core.%pto /etc/sysctl.conf