Tuesday, May 21, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 2547  / 2 Years ago, wed, november 16, 2022, 5:52:25

Currently I have enabled core dumps by editing /etc/limits.conf and addig * soft core unlimited as well as using ulimit -c unlimited.



But the core_pattern is this:



kernel.core_pattern = |/usr/share/apport/apport %p %s %c %P


So the core is transmitted to apport. I don't mind, and I don't want to mess with apport (I have a memory of something going wrong once when doing so), moreover apport nicely generates a core file in the directory of my binary when it crashes.



Is there any way to edit the location where apport saves the core, or its file name (instead of a simple core)? Similar to what I could do by disabling apport and editing the core_pattern, but without disabling apport.


More From » kernel

 Answers
0

I found a better way to do this as making changes to apport means that every time we upgrade apport we will have to add in our changes.



Linux allows you to provide a shell script as the program to execute every time a core is generated. Inside this core file, you can call apport as always and then do your custom stuff. This includes changing the name and location of the core file.



To find the path of the core generated by apport, you can use the following



core_dir=realpath '/proc/$1/cwd'

[#20115] Thursday, November 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
azaaburge

Total Points: 266
Total Questions: 85
Total Answers: 109

Location: Djibouti
Member since Sat, Oct 29, 2022
2 Years ago
azaaburge questions
Thu, Jun 2, 22, 23:28, 2 Years ago
Sun, Oct 17, 21, 05:20, 3 Years ago
Fri, Jun 25, 21, 16:22, 3 Years ago
;