linux abrt的用法

简介: 一般是可以通过在环境变量中设置ulimit -c unlimited。但是现场实施人员有时会忘记设置这条命令。那么怎么办呢,可以通过设置linux的abrt服务来实现。

在linux调试程序,最痛苦的就是程序异常宕掉,但是找不到core文件,很难定位问题。但是有了core文件就容易定位多了。


一般是可以通过在环境变量中设置ulimit -c unlimited。但是现场实施人员有时会忘记设置这条命令。那么怎么办呢,可以通过设置linux的abrt服务来实现。


修改abrt-action-save-package-data.conf文件


将其修改为:


vi /etc/abrt/abrt-action-save-package-data.conf
# With this option set to "yes",
# only crashes in signed packages will be analyzed.
# the list of public keys used to check the signature is
# in the file gpg_keys
#
OpenGPGCheck = no
# Blacklisted packages
#
BlackList = nspluginwrapper, valgrind, strace, mono-core
# Process crashes in executables which do not belong to any package?
#
ProcessUnpackaged = yes
# Blacklisted executable paths (shell patterns)
#
BlackListedPaths = /usr/share/doc/, /example*, /usr/bin/nspluginviewer, /usr/lib/xulrunner-*/plugin-container


还可以调整core文件的大小:


[root@xx-host2 abrt]# cat abrt.conf 
# Enable this if you want abrtd to auto-unpack crashdump tarballs which appear
# in this directory (for example, uploaded via ftp, scp etc).
# Note: you must ensure that whatever directory you specify here exists
# and is writable for abrtd. abrtd will not create it automatically.
#
#WatchCrashdumpArchiveDir = /var/spool/abrt-upload
# Max size for crash storage [MiB] or 0 for unlimited
#
MaxCrashReportsSize = 1000
# Specify where you want to store coredumps and all files which are needed for
# reporting. (default:/var/spool/abrt)
#
# Changing dump location could cause problems with SELinux. See man abrt_selinux(8).
#
#DumpLocation = /var/spool/abrt
# If you want to automatically clean the upload directory you have to tweak the
# selinux policy.
#
DeleteUploaded = no


重启 abrtd 服务:  service abrtd restart


有了core文件也需要及时删除,通过abrt-cli list查看文件的包,然后用abrt-cli rm 【文件包】就可以了。


abrt-cli rm <ccpp folder from list >


相关文章
|
6月前
|
监控 Shell Linux
Linux Shell高级用法:优化和自动化你的工作流程
Linux Shell是一个非常强大的工具,可以用于自动化任务、处理文本和数据、进行系统管理等。在这篇文章中,我们将介绍一些Linux Shell的高级用法,帮助你更高效地利用Shell完成各种任务。
97 0
|
7月前
|
Unix Linux
完全指南:mv命令用法、示例和注意事项 | Linux文件移动与重命名
完全指南:mv命令用法、示例和注意事项 | Linux文件移动与重命名
858 0
|
1月前
|
缓存 Ubuntu 网络协议
Linux系统编程之文件I/O函数的使用:介绍文件I/O函数的基本概念、用法和实现方式
Linux系统编程之文件I/O函数的使用:介绍文件I/O函数的基本概念、用法和实现方式
21 1
|
1月前
|
Linux
Linux系统编程之exec函数簇的使用:剖析exec函数簇的实现原理、参数解释和用法技巧
Linux系统编程之exec函数簇的使用:剖析exec函数簇的实现原理、参数解释和用法技巧
38 0
|
1月前
|
存储 Linux
Linux系统编程之Linux 信号集编程:信号集的基本概念、用法和实现方式
Linux系统编程之Linux 信号集编程:信号集的基本概念、用法和实现方式
12 0
|
1月前
|
Linux C语言
Linux系统编程之 Linux信号的编程:信号的基本概念、用法和实现方式
Linux系统编程之 Linux信号的编程:信号的基本概念、用法和实现方式
15 0
|
1月前
|
Linux
linux系统中select函数的用法实现
linux系统中select函数的用法实现
18 0
|
6月前
|
NoSQL Linux 编译器
详讲yum包管理器/Vim编辑器/gdb调试器的基础用法【Linux】
详讲yum包管理器/Vim编辑器/gdb调试器的基础用法【Linux】
75 0
|
6月前
|
Java Linux Windows
【Java用法】Java在Linux下获取当前程序路径以及在Windows下获取当前路径对比
【Java用法】Java在Linux下获取当前程序路径以及在Windows下获取当前路径对比
134 0
|
2月前
|
存储 Shell Linux
Linux的shell命令——变量用法
Linux的shell命令——变量用法
32 0