You are not logged in.

#1 2014-11-25 02:46:04

bdantas
Member
Registered: 2014-05-13
Posts: 94

how to change core dump storage location to current working directory?

I would like to tell systemd to put core dumps in current working directory, not in /var/lib/systemd/coredump as is happening by default.

The Storage line in /etc/systemd/coredump.conf looks promising. man 5 coredump.conf gives me this:

Storage=
           Controls where to store cores. One of "none", "external",
           "journal", and "both". When "none", the coredumps will be logged
           but not stored permanently. When "external" (the default), cores
           will be stored in /var/lib/systemd/coredump. When "journal", cores
           will be stored in the journal and rotated following normal journal
           rotation patterns. When "both", cores will be stored in both
           locations.

I guess what I need is the default external setting, but with a directive somewhere else to specify that $pwd should be the storage location, not /var/lib/systemd/coredump. I checked the wiki (Core dump) but no luck there.

Please, how do I change the core dump storage location from /var/lib/systemd/coredump to the current directory?

Offline

#2 2014-11-25 03:47:45

ponyrider
Member
Registered: 2014-11-18
Posts: 112

Re: how to change core dump storage location to current working directory?

why not just create a symbolic link?

ln -s /var/lib/systemd/coredump /path/to/directory

Last edited by ponyrider (2014-11-25 03:51:12)

Offline

#3 2014-11-25 04:54:05

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: how to change core dump storage location to current working directory?

ponyrider wrote:

why not just create a symbolic link?

ln -s /var/lib/systemd/coredump /path/to/directory

That location could change very often.


bdantas, remember you have to have write permissions for the directory.

Offline

#4 2014-11-25 13:06:14

bdantas
Member
Registered: 2014-05-13
Posts: 94

Re: how to change core dump storage location to current working directory?

The location is variable so the symlink idea won't work, unfortunately.

karol: yes, I'd have write permissions for all the directories I'd be working in.

EDIT: If there is no way to redirect systemd with this, I'd be perfectly happy to use another route (i.e., to turn off systemd's coredump management and use some other utility to create and store coredumps in $pwd).

Last edited by bdantas (2014-11-25 13:11:10)

Offline

#5 2022-05-28 22:56:22

PerpetualLearner
Member
Registered: 2020-07-19
Posts: 7

Re: how to change core dump storage location to current working directory?

It's an old question, but just in case someone is still looking for the answer, dumping core to the current working directory is the default Linux behavior, all one needs to do is to replace the contents of their, likely systemd-installed,

/proc/sys/kernel/core_pattern

to

core

, for example:

$ echo core | sudo tee /proc/sys/kernel/core_pattern

.

man [-s 5] core

is useful for understanding the gore details.


kiss dry pola

Offline

#6 2022-05-28 23:00:36

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,648

Re: how to change core dump storage location to current working directory?

Closing this ancient thread.

Offline

Board footer

Powered by FluxBB