Modify the core dump file path: Method 1: Temporary modification: Modify the/proc/sys/kernel/core_pattern file/proc The directory itself is dynamically loaded each time the system reboot will be reloaded so the method can only be modified temporarily
/proc/sys/kernel/core_pattern
Example: Echo '/var/log/%e.core.%p ' >/proc/sys/kernel/core_pattern Method 2: Permanent modification:
Using the sysctl-w name=value command
Example:/sbin/sysctl-w kernel.core_pattern=/var/log/%e.core.%p A more detailed record of the core dump at the time of the system state through the following parameters to enrich the core file name:
%p-insert pid into filename add PID
%u-insert current UID to filename to add the present UID
%g-insert current GID into filename to add an existing GID
%s-insert signal that caused the coredump into the filename adds a signal that causes the core to be generated
%t-insert Unix time, the coredump occurred into filename when you add a core file when you build Unix
%h-insert hostname where the coredump happened into filename adds host name
%e-insert coredumping executable name into filename add command name
Set the core file generation path and file name under Linux