Controlling core files (Linux)
core file文件重定位:echo /tmp/core.%e.%p > /proc/sys/kernel/core_pattern
Core files get created when a program misbehaves due to a bug, or a violation of the cpu or memory protection mechanisms. The operating system kills the program and creates the core file.
If you don't want core files at all, set "ulimit -c 0" in your startup files. That's the default on many systems; in /etc/profile you may find
ulimit -S -c 0 > /dev/null 2>&1
If you DO want core files, you need to reset that in your own .bash_profile:
ulimit -c 50000
would allow core files but limit them to 50,000 bytes.
You have more control of core files in /proc/sys/kernel/
For example, you can do eliminate the tagged on pid by
echo "0" > /proc/sys/kernel/core_uses_pid
Core files will then just be named "core". People do things like that so that a user can choose to put a non-writable file named "core" in directories where they don't want to generate core dumps. That could be a directory (mkdir core) or a file (touch core;chmod 000 core). I've seen it suggested that a symlink named core would redirect the dump to wherever it pointed, but I found that didn't work.
But perhaps more interesting is that you can do:
mkdir /tmp/corefiles
chmod 777 /tmp/corefiles
echo "/tmp/corefiles/core" > /proc/sys/kernel/core_pattern
All corefiles then get tossed to /tmp/corefiles (don't change core_uses_pid if you do this).
Test this with a simple script:
# script that dumps core
kill -s SIGSEGV $$
分享到:
相关推荐
The third edition features new commands for processing image files and audio files, running and killing programs, reading and modifying the system clipboard, and manipulating PDF files, as well as ...
It guides you on implementing some of the most common commands in Linux with recipes that handle any of the operations or properties related with files like searching and mining inside a file with ...
It guides you on implementing some of the most common commands in Linux with recipes that handle any of the operations or properties related with files like searching and mining inside a file with ...
It guides you on implementing some of the most common commands in Linux with recipes that handle any of the operations or properties related with files like searching and mining inside a file with ...
7. Controlling Access to Files 8. Monitoring and Managing Linux Processes 9. Controlling Services and Daemons 10. Configuring and Securing SSH 11. Analyzing and Storing Logs 12. Managing ...
Centrally managing User Mode Linux instances, and controlling their hardware resources Implementing clusters and other specialized configurations Setting up User Mode Linux servers, step-by...
路由器配备很大的入站缓冲区,以便不惜一切代价避免丢包...为了解决这个问题,有人提出了新的CoDel主动队列管理算法,且已经在Linux内核3.5以上版本中实现。ACM的这篇论文《Controlling Queue Delay》有详细的介绍。
controlling special permissions, encrypting file systems, and much moreMaster the art of securing a Linux environment with this end-to-end practical guideBook Description This book has extensive ...
In this introduction, I explain the meaning of the acronym SAP, the origin of SAP, and the concept of SAP implementation. We will go further to look at Enterprise Resource Plan
主要介绍机械系统控制建模辨识等方面的内容,对于一些初学者来说非常有用。
Robot Programming: A Guide to Controlling Autonomous Robots: Covers both ARM9 and ARM7 micro-controllers, including the newest LEGO Mindstorms EV3 and Wowee RS Media Robots.
Controlling-Profitability Analysis with SAP Controlling-Profitability Analysis with SAP
Foundations of Controlling.ppt
Workflow-based Process Controlling,作者:Michael zur Muehlen
Controlling external windows
Controlling Chaotic Dynamical Systems via OGY Control Method Based on Targeting
详细介绍了MPS.MRP
Controlling Media Servers SIP
Workflow based invoice controlling for SAP R/3
Controlling Radiated EMI Through PCB Stack