I have some init scripts that launch some daemons that I wrote. I want Linux to generate a coredump anytime something crashes. I activated coredumps in /etc/security/limits.conf by adding the next line:

* hard core 100000

After rebooting, I run ulimit -a and I can see that coredumps are not activated:

> root@computer:~# ulimit -a
> core file size          (blocks, -c) 0

First, I checked if there is any file script on my system that deactivates coredumps (greping ulimit -c 0 ), but I didn't find anything so far.

Then, I created a bogus c program..to double check if it's working, and I can confirm that it's not. The program is this

int main() {
  int *p;
  return *p;

After running it, no coredump is generated

root@computer:~# ./a.out 
Segmentation fault

I know that coredump works (and it's activated in the kernel), because after running ulimit -c 100000 and repeating the test above, a coredump is generated.

root@computer:~# ulimit -c 100000
root@computer:~# ./a.out 
Segmentation fault (core dumped)
root@computer:~# ls
a.out  core

I'm really out of ideas. Any help?

Thanks in advanved!!


You need to set soft core too. There are two sets of limits. From the man page:

# cat /etc/debian_version 
# man limits.conf:


                   for enforcing hard resource limits. These limits are set by the superuser and enforced by the Kernel. The user cannot raise his requirement of system resources above such values.

                   for enforcing soft resource limits. These limits are ones that the user can move up or down within the permitted range by any pre-existing hard limits. The values specified with this token can be
                   thought of as default values, for normal system usage.

                   for enforcing both soft and hard resource limits together.

You can just change 'hard' in your limits.conf to '-' and it should fix it. Or you can be more verbose and add a specific line for soft (maybe setting it smaller).



  • soft core unlimited
  • hard core unlimited


  • soft core 10000
  • hard core 10000

do NOT work on my Debian Squeeze servers.

After reboot : root@sla:~# ulimit -c 0

This is annoying


root@sla:~# sysctl kernel.core_pattern

kernel.core_pattern = /var/log/dumps/core.%t.%e.%p_%u-%g


inside /etc/profile at end :

The line below set the soft limit to stop creation of coredumps for

all users

ulimit -S -c 0 > /dev/null 2>&1

I replaced with :

ulimit -c unlimited > /dev/null 2>&1

And now it work:D


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.