Theo de Raadt wrote:
> There isn't a way. And I will argue there shouldn't be a way to do that.
> I don't see a need to invent such a scheme for one user, when half a century
> of Unix has no way to do this.
> Sorry.
I have a different use case than Johannes but looking for a similar feature.
Maybe I can convince you :>
For background, I develop multi-process daemons and OpenBSD is
the only platform I'm noticing segfaults on[1].
The lack of PIDs in the core filenames means they can get
clobbered in parallel scenarios and I lose useful information.
Sometimes, daemons run in / (or another unwritable directory);
and the core dump can't get written, at all.
On Linux, I've set sys.kernel.core_pattern=/var/tmp/core and
sys.kernel.core_uses_pid=core_uses_pid[2] since the early 2000s
or so to minimize my chance of losing important core dumps.
Thanks for reading.
[1] something in Perl / DBD::SQLite destruction order; not sure
if it's down to the versions of the software packaged for
OpenBSD or something else. I haven't seen it on Linux nor FreeBSD;
but yeah, Perl destruction with interelated XS objects graphs
get tricky...
[2] Nowadays, Linux core_pattern supports printf-like formats,
but I've been relying on it for longer.
> Johannes Thyssen Tishman <[email protected]> wrote:
>
> > Hi everyone,
> >
> > is there a way to configure a location to store userland core dumps?
> > I'd like to store them in /tmp to keep them available only until
> > the next reboot. This way I can avoid having core dumps, that
> > sometimes I don't even know about, scattered all over my home
> > directory.
> >
> > I've read about 'sysctl kern.nosuidcoredump' in sysctl(8), but I
> > believe files stored under /var/crash/${program} are persistent
> > after reboots, right? Also, I know I can disable them from
> > /etc/login.conf, but I'd prefer to keep them at least until the
> > next reboot just in case.
> >
> > I'm sure that there must be a reason for why OpenBSD defaults to
> > dumping core files like it does, so please let me know if what I'm
> > asking is a bad idea. I would really appreciate it.
> >
> > Thank you.
> >
> > Kind regards,
> > Johannes
> >