Linux内核参数测试,linux 内核参数core_pattern测试

linux 内核参数core_pattern测试

参数介绍

. If the first character of the pattern is a '|', the kernel will treat

the rest of the pattern as a command to run. The core dump will be

written to the standard input of that program instead of to a file.

简单来说,该参数就是可以设定core dump文件的文件名及路径,以及可以利用管道将结果输入给管道右边的程序进行处理。

配置方式

设定core文件的最大值,默认为0,即不生成,只针对当前shell

ulimit -c 1024

查看当前core_pattern配置

#cat /proc/sys/kernel/core_pattern

core-%e-%p-%t

修改参数

#echo "/root/core_dump/core-%e-%p-%t" > /proc/sys/kernel/core_pattern

echo "/home/chenyuhao/core_dump/core-%e-%p-%t" > /proc/sys/kernel/core_pattern

测试方法

模拟生成core dump

sleep 15

按下Ctrl+\

修改core_pattern参数,是否能按照指定的路径及文件名生成dump。

echo "/root/core_dump/core-%e-%p-%t" > /proc/sys/

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值