Set the core file generation path and file name under Linux

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.