Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AIX 6.1: Change default core file name from core to core.pid.ddhhmmss

562 views
Skip to first unread message

Ouray Viney

unread,
Aug 25, 2009, 11:04:09 PM8/25/09
to
I have reviewed the man page, but it isn't clear to me how I can
change the default name of a core file that is generate when running
kill -6 PID.

I have tried 'chcore -n on'

Any ideas?

sjm

unread,
Aug 26, 2009, 6:31:50 AM8/26/09
to

Try logging out and then back in - worked for me on AIX 5.2 and AIX
6.1.

Ouray Viney

unread,
Aug 26, 2009, 10:36:13 AM8/26/09
to

When you say it worked for you, what exactly worked for you? When I
set the core file name format using 'chcore -n on', logged off from my
ssh session, logged back in, ran kill -6 <PID>, same as before, core
was written but with standard name format, just place old 'core', no
pid or timestamp.

I appreciate your input, but perhaps you can be a little more specific
about what you did and how you verified that it was working.

Take a real simple example, just run "sleep 20 &", then in the same
session, run kill -6 <PID OF SLEEP>. Then perform an ls core* in the
directory that you ran the command from.

Thanks

sjm

unread,
Aug 26, 2009, 12:43:12 PM8/26/09
to

# pwd
/
# mkdir corefiles
# cd corefiles
# sleep 100 &
[1] 381012
# kill -6 381012
#
[1] + IOT/Abort trap(coredump) sleep 100 &
# ls -l
total 16
-rw------- 1 root system 7188 26 Aug 17:39 core
# chcore -n on
# sleep 100 &
[1] 381024
# kill -6 381024
# ls -l
total 16
-rw------- 1 root system 7188 26 Aug 17:41 core
[1] + IOT/Abort trap(coredump) sleep 100 &
# exit

<log in again>

# cd corefiles
# ls -l
total 16
-rw------- 1 root system 7188 26 Aug 17:41 core
# sleep 100 &
[1] 381032
# kill -6 381032
#
[1] + IOT/Abort trap(coredump) sleep 100 &
# ls -l
total 32
-rw------- 1 root system 7188 26 Aug 17:41 core
-rw------- 1 root system 7188 26 Aug 17:42 core.
381032.26224212
#


Ouray Viney

unread,
Aug 26, 2009, 3:15:30 PM8/26/09
to

Oustanding! Thank you very much for taking the time to try it all
out. The only difference that I can see, is that you ran your
commands as root. I am running as a non-root user. I will try the
sames tests and post my results.

Thank you again.

Ouray Viney

unread,
Aug 26, 2009, 4:25:40 PM8/26/09
to

Indeed your test results are correct. I am getting the same results
when I am running the tests as root.

If I run these commands as a non-root user I still get the 'core' not
core.pid.date.

running lscore as my non-root user shows:

:~ 04:24 PM> lscore
compression: off
path specification: off
corefile location: not set
naming specification: on

I also tried setting the default to on for all users and specifically
for my non-root user:

sudo chcore -n on -d

and

sudo chcore -n on <non-root-user>

Any ideas what I might be doing wrong here. I would like this to work
for a non-root user.

Much apprecaited

Henry

unread,
Aug 26, 2009, 10:55:49 PM8/26/09
to

aren't core dumps a potential security hole ?

sjm

unread,
Aug 27, 2009, 10:48:27 AM8/27/09
to

# su - user
$ sleep 100 &
[1] 463006
$ kill -6 463006
$


[1] + IOT/Abort trap(coredump) sleep 100 &

$ ls -latr
total 32
-rwxr----- 1 user staff 254 27 Aug 15:47 .profile
drwxr-xr-x 7 bin bin 256 27 Aug 15:47 ..
-rw-r--r-- 1 user staff 7188 27 Aug 15:47 core.
463006.27204743
drwxr-xr-x 2 user staff 256 27 Aug 15:47 .
-rw------- 1 user staff 42 27 Aug 15:47 .sh_history
$

Ouray Viney

unread,
Aug 27, 2009, 11:35:42 AM8/27/09
to

Any ideas how to get this working for a non-root user?

Thanks,

Ouray Viney

unread,
Aug 27, 2009, 11:36:07 AM8/27/09
to

Isn't the sky blue?

ibph...@gmail.com

unread,
Sep 23, 2015, 3:04:03 AM9/23/15
to
> Isn't the sky blue?

A bit late but try to set the variable export CORE_NAMING=yes in your environment, (turn off by setting to null export CORE_NAMING= ). This
worked for us.
0 new messages