Linux coredump Study Notes and coredump Study Notes
Beginner's notes:
In the case of exceptions in linux programs, the process will be down. Most servers will set up to generate core files. In actual operation, I have encountered a process that keeps core and is automatically monitored and pulled up, if a core exists after a period of time, the disk is fully occupied and the service is affected.
After learning about core
Core File size limit:
Ulimit-c can change the core file size, but unfortunately it is effective for the current terminal. Simply put, when you exit the current logon, the default value is changed when you use ulimit-c again.
To completely change the configuration file, you need to modify the configuration file. Different servers may not point to the configuration file. Here we first record the actual access:
/Etc/profile:
# if test "$is" != "ash" -a ! -r /etc/initscript; then ulimit -Sc 10255 # don't create core files# ulimit -Sd $(ulimit -Hd)# ulimit -Ss $(ulimit -Hs)# ulimit -Sm $(ulimit -Hm)# fi
/Etc/security/limits. conf:
The preceding * represents all users, and can be configured based on specific users, such as root,
* soft core 10240* hard core 102400#* hard rss 10000#@student hard nproc 20#@faculty soft nproc 20#@faculty hard nproc 50#ftp hard nproc 0#@student - maxlogins 4
To modify the limits. conf file, make sure that the pam_limits.so file is added to the Startup File. View the/etc/pam. d/login file: session required/lib/security/pam_limits.so
Limits. conf is the configuration file of pam_limits.so, and the application under/etc/pam. d/calls the pam _ ***. so module. When the user accesses the server, the program sends the request to the PAM module. The PAM module is in/etc/pam according to the service name. d. Select a corresponding service file under the directory, and then select a specific PAM module based on the service file content for processing. soft, hard, and -, here, soft refers to the setting value that takes effect for the current system. Hard indicates the maximum value that can be set in the system. Soft cannot be more restrictive than har. -Indicates that both soft and hard values are set.
In addition, the core storage path is as follows:
root@huang:/data/coredump# cat /proc/sys/kernel/core_patterncoreroot@huang:/data/coredump# echo '/data/coredump/core_%e_%t' > /proc/sys/kernel/core_pattern root@huang:/data/coredump# cat /proc/sys/kernel/core_pattern/data/coredump/core_%e_%t