Apport: Change core dumps path on ubuntu 16.04 from /var/crash to /var/coredumps

Asked by Chinnu

By default core dumps are logged at /var/crash on Ubuntu 16.04.
How to change the path for it to /var/coredumps

I tried

echo "/var/coredumps/core-%e-pid%p-time%t" > /proc/sys/kernel/core_pattern

edited /etc/init.d/apport as below
# echo "|$AGENT %p %s %c %P" > /proc/sys/kernel/core_pattern ### Commented this line and added below line
        echo "/var/coredumps/core-%e--pid%p-time%t" > /proc/sys/kernel/core_pattern

restarted apport. But still it doesn't work.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Could use a symlink.

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Needs information' state without activity for the last 15 days.

Revision history for this message
Chinnu (panjalanaveen540) said :
#3

@actionparsnip : My question was I don't want to use /var/crash anymore. I need it to be dumped to /var/core.

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

1. What is the difference in using /var/coredumps instead of /var/crash?

2. I assume that apport always uses /var/crash, and when apport is starting, it will register itself in /proc/sys/kernel/core_pattern overwriting whatever you put there (see also /etc/init/apport.conf).
If you change /proc/sys/kernel/core_pattern then you must not enable apport afterwards again.
You can set "enabled=0" in /etc/default/apport to prevent it from starting, and it should no more change /proc/sys/kernel/core_pattern
Setting kernel.core_pattern in /etc/sysctl.conf (or /etc/sysctl.d/*.conf) would -in my opinion- be the right approach, and keeping apport disabled, instead of modifying apport's configuration in a way that probably breaks its function.

Can you help with this problem?

Provide an answer of your own, or ask Chinnu for more information if necessary.

To post a message you must log in.