Tom Horsley writes:
On Fri, 01 Jun 2018 23:15:24 -0400
Sam Varshavchik wrote:
> On the machine where you do development work, and have to deal with core
> dumps all the time, you can rig this to be done automatically during the
> boot, and completely avoid having to deal with all that brain damage.
Permanently go back to the "old" way:
cat 'kernel.core_pattern = core' >> /etc/sysctl.conf
Hmm, I looked into this. What you really want to do is
echo "kernel.core_pattern = core" >/etc/sysctl.d/50-coredump.conf
According to the comments in sysctl.conf, this should override what systemd
installs in /usr/lib/sysctl.d
Also, I can't tell if it is still screwed up or not because
the bugzilla about it is incomprehensible, but you may
also need to edit /etc/systemd/system.conf and set
DefaultLimitCORE=0:infinity
At one time, this changed so that ulimit was always set for
everyone to always dump core (in the previous reality
you had to use ulimit -c to enable core dumps when you
knew you wanted them). This changed default then left core
files scattered all over your system.
Actually, it's better to manually set the ulimit in your shell. This way, if
some random process dumps core it won't spew it somewhere.
If I ever get motivated enough, I might look into a wrapper that checks if
the process that's dumping core comes from /home, and if so writes the core
file normally, else it gets thrown away completely.