大网数据广告活动
服务器运维问答

Enable coredump centos 7 with systemd

· 52CE 我爱测

I went through couple of articles after some googling but nothing seems to work. I am using Centos 7. Let me explain what have I done so far. I followed step by step http://www.kibinlabs.com/re-enabling-core-dumps-redhat-7/ After…

问题原文

原帖链接 · chandank · CC BY-SA 4.0

I went through couple of articles after some googling but nothing seems to work.

I am using Centos 7.

Let me explain what have I done so far.

I followed step by step

http://www.kibinlabs.com/re-enabling-core-dumps-redhat-7/

After that, I can get the coredump generated but only if I start the process manually, however, whenvever I start the process like

systemctl start <myprocess>

it does not generate coredump after killing with SEGV

kill -11 <pid>

var/log/messages shows that it got the signal SEGV but I cant see the coredump.

The kernel core pattern is also set.

cat /proc/sys/kernel/core_pattern
/var/lib/coredumps/core-%e-sig%s-user%u-group%g-pid%p-time%t


coredump.conf 

cat /etc/sysctl.d/50-coredump.conf
Storage=both

cat  /etc/sysctl.d/99-sysctl.conf
fs.suid_dumpable = 1
kernel.core_uses_pid = 1

    Storage=both
    [root@server01 coredumps]# ls -l /etc/sysctl.d/50-coredump.conf
    lrwxrwxrwx 1 root root 26 Aug  6 13:51 /etc/sysctl.d/50-coredump.conf -> /etc/systemd/coredump.conf

已采纳解答

原帖链接 · Alex · CC BY-SA 3.0

I believe you might be trying to kill a daemon with the SUID bit set.

In that case you will need to use fs.suid_dumpable = 2

The other thing to make sure is that the permission on the whole path where you save the core dump has proper permission.

In your case it means that users need to be able to execute on /var on /var/lib and be able to write in /var/lib/coredumps.

The users here are actually the users that own the process being killed, not the user killing the process.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-08-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。