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 ...
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
### 控制具有回差的机械系统 #### 回差的概念及其影响 回差(backlash)是机械系统中一个重要的非线性因素,它限制了速度和位置控制的性能,在工业、机器人技术、汽车制造、自动化以及其他应用领域都有显著的影响...
- **Managing Processes**: Killing, restarting, and controlling processes using `kill`, `killall`, and `nice`. #### Chapter 10: Managing the System This chapter covers advanced system management tasks...
【7011财务会计与控制】:这个主题主要涵盖了企业内部的财务管理和生产计划方面的内容,特别是关于Master Production Scheduling (MPS)和Material Requirements Planning (MRP)的运用。 MPS,即主生产排程,是企业...
标题:“Controlling-Profitability Analysis with SAP”表明这本书是一本关于如何使用SAP软件系统来进行成本控制和盈利能力分析的专业书籍。成本控制和盈利能力分析是企业财务管理中的重要环节,对于企业来说,通过...
Workflow based invoice controlling for SAP R/3
The libusb library provides a unified API for accessing and controlling USB devices, making it easier for developers to develop USB drivers. By using the libusb library, developers can focus on the ...
- **守护进程**:编写后台运行的程序,detach from controlling terminal。 - **系统日志**:使用syslog函数记录应用程序日志。 - **性能监控**:使用getrusage、clock_gettime等获取系统资源使用情况。 6. **...
It’s in these chapters that you’ll really master controlling Linux! Part 5 covers multimedia functions built into Ubuntu, which let you watch movies and play back music. We also take a look at the ...
It’s in these chapters that you’ll really master controlling Linux! Part 5 covers multimedia functions built into Ubuntu, which let you watch movies and play back music. We also take a look at the ...
- **Access Control**: Explains mechanisms for controlling user access. - **Shell Startup**: Describes shell startup processes and scripts. #### Managing User Accounts The guide provides instructions...