How to remove limit on core dump file size

Peter Bašista

I would like to increase the maximum size limit for core dump files as a regular user. Using bash, I can set it like this:

$ ulimit -c 100

which works well the first time I set it. However, the next time I use this command, I can only set this limit to a value not exceeding 100. In general, I can set it to an arbitrary value only the first time I use this command since login. All the next times, the possible values are limited from above by the initially set value.

How can I make this persistent across multiple uses of the command?

Kevin Bowen

Per @Peter Bašista's answer in his own question:

At first, I thought this is an error and that's why I started this question. But it turned out it's simply a perfectly correct behavior. It turns out that RTFM saying applies here as well.

As man bash reveals, the ulimit built-in command has additional parameters: -H for setting the so-called hard limits and -S for setting the so-called soft limits. Moreover, if none of these options are given, the default behavior is that ulimit tries to set both the soft and the hard limits to the same value at once. And that was the problem.

Now there is a quote from the bash man page:

A hard limit cannot be increased by a non-root user once it is set;

So, there we go. The correct usage of ulimit command should always have this in mind. Most importantly, it should never be used without -H or -S options unless you are sure to know what you are doing (which at the time I obviously wasn't).

What I should have done is something like this:

After login: ulimit -H -c unlimited

Each time I want to change maximum core dump size limit ulimit -S -c <new size>

So, that's about it. I hope it could help someone who might struggle with a similar problem.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

How to set a file size limit for a directory?

분류에서Dev

FreeBSD core dump file permissions

분류에서Dev

Teamcity document file size limit

분류에서Dev

Limit pipe size and write to temporary file as a fallback

분류에서Dev

Lift Vim undo-tree file size limit?

분류에서Dev

Can I limit the file size for a attachinary/cloudinary upload

분류에서Dev

How to set breakpoints and make it break when debugging core dump with gdb?

분류에서Dev

How to fetch size of file in excel?

분류에서Dev

How to force HotSpot JVM to overwrite heap dump file?

분류에서Dev

How Can I Create A Dump File of a Running Process in Linux?

분류에서Dev

How to create a MySQL database from dump file in expect/TCL script?

분류에서Dev

AIX: How to find sftp file limit?

분류에서Dev

Analyzing a crash dump file

분류에서Dev

Limit IIS Log Size

분류에서Dev

rails 4 how ro remove the limit condition from sqlite

분류에서Dev

How does cache acess time limit the maximum frequency of a core?

분류에서Dev

How to tar.gz many similar-size files into multiple archives with a size limit

분류에서Dev

How to get file size in hex format?

분류에서Dev

Resize a dd dump without changing partition size

분류에서Dev

HttpClient buffer size limit exceeded

분류에서Dev

Does ListView has a size limit?

분류에서Dev

Upload size limit in bytes (django)

분류에서Dev

Python Dictionary Size Maximum Limit

분류에서Dev

What is the disk size limit for mdadm?

분류에서Dev

How to limit the characters in file name preview selected for upload?

분류에서Dev

how to remove file details from multi array

분류에서Dev

How to remove blocks of text from file

분류에서Dev

String from file names - How remove the extension?

분류에서Dev

How to remove a special string from a file?

Related 관련 기사

뜨겁다태그

보관