Recently I had an experience where a core dump was created in my home directory that resulted in the filesystem running out of space.
How can I tell AIX to create core dumps in some other location?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this communityThis page from IBM seems to have everything you'd need to know about core dump files under AIX.
The command you're looking for looks to be chcore
. Here's an excerpt from that page:
A central core file repository can be set up for all accounts on the system, but each account may override the default and install a custom repository. Select a file system with plenty of free space for this repository. All accounts will need read and write access to this directory. To prevent users from deleting core files created by other users, the sticky bit should be enabled. Permissions on this directory should normally be 1777, the same as for
/tmp
.To set up a system-wide core file repository with unique core file naming, run the following commands as root:
$ cd /path/to/filesystem $ mkdir corefiles $ chmod 1777 $ ./corefiles $ chcore -p on -n on -l ./corefiles
Note: Add the option -c on to turn on core file compression. The settings will only be effective for newly logged in accounts and will persist across reboots.
To override the system-wide default repository and set up a repository for a specific user, run the following commands as the user:
$ mkdir ~/corefiles $ chcore -p on -n on -l ~/corefiles
By default, core dumps will simply live in the relative path set by the core_pattern (usually this means the current working directory of the process that cores). If you prepend an absolute path to the core_pattern, then it should place the dumps there instead.
You can do this by using sysctl, or directly dumping a value into /proc
For example:
$ echo "/tmp/cores/core.%e.%p.%h.%t" > /proc/sys/kernel/core_pattern
The cores dumps will now live in /tmp/cores/
EDIT:
Sorry, I missed that this was for AIX. For that, you can use the chcore utility.
i.e., chcore -p on -l /tmp/cores/
You can also add the -d
flag to make it the system default.
/proc/sys/kernel
folder.
Sep 30, 2014 at 16:10