User Tools

Site Tools


aix:core_mgmt

This is an old revision of the document!


Core files Management

Check the progam associated to a core file, and all dependent libraries:

root@nim /root # /usr/lib/ras/check_core /export/lpp_source/base-aix61tl6/core
/usr/lib/libc.a
/usr/lib/libodm.a
/usr/lib/libinstall.a
/usr/lib/libcfg.a
/usr/lib/libcrypt.a
/usr/lib/nls/loc/en_US
/usr/lib/libi18n.a
/usr/lib/libiconv.a
installp

The following file is not a core file, just a file named “core”:

root@nim /root # /usr/lib/ras/check_core /etc/security/aixpert/core
check_core:: Error 0

Best practice: centalize core

In order to centralize cores at one place

- Create a dedicated filesystem, with full permissions for everybody

root@nim /root # mklv -tjfs2 -y corelv rootvg 1G
root@nim /root # crfs -vjfs2 -m /var/core -d corelv -Ayes -a log=INLINE
root@nim /root # mount /var/core
root@nim /root # chmod 777 /var/core

User core path

- Change the path to centralize all cores for all user into /var/core; this command will set the default parameters for cores in /etc/security/user. User cores are persistent parameters.

root@nim /root # lscore
compression: off
path specification: off
corefile location: not set
naming specification: off
root@nim /root # chcore -c on -p on -l /var/core -n on -d
root@nim /root # lscore
compression: on
path specification: on
corefile location: /var/core
naming specification: on

syscorepath

- While it's not persistent, system core have to be set at every start by adding an entry into /etc/inittab

root@nim /root # syscorepath -g

root@nim /root # echo '#!/bin/ksh
# Set core path for system
if [[ "$(uname -W)" == "0" ]]
then
  if [ -d /var/core ]
  then
    syscorepath -p /var/core
    if [ $? -eq 0 ]
    then
      echo "syscorepath OK"
    fi
  else
    echo "**** ERROR /var/core doesn t exist"
  fi
fi
' > /etc/rc.syscore
root@nim /root # chmod +x /etc/rc.syscore
root@nim /root # mkitab "syscore:23:once:/etc/rc.syscore > /dev/console 2>&1"
root@nim /root # /etc/rc.syscore
root@nim /root # syscorepath -g
/var/core

Check core size per user

- If required change user core parameter to take the default value. Here for example for the root user.

root@nim /root # cat /etc/security/limits
....
default:
        fsize = 2097151
        core = 2097151
        cpu = -1
        data = 262144
        rss = 65536
        stack = 65536
        nofiles = 2000

root:
        fsize = -1
        core = 0
        data = 524288
root@nim /root # chuser -R files -a core='' root

Generate a core file

Allow root user to produce cores, if ulimit -c is 0 then no core allowed

root@nim /root # ulimit -c
0
root@nim /root # lsuser -a core root
0
root@nim /root # ulimit -c 2097151
root@nim /root # while true
do
sleep 14
done &
[1]     8257538
root@nim /root # kill -3 8257538
root@nim /root # ls -l /var/core
total 48
-rw-------    1 root     system        11159 Oct 18 12:02 core.8257538.18100246.Z
drwxr-xr-x    2 root     system          256 May 19 2016  lost+found
[1] + Quit(coredump)           while true;do;sleep 14;done &
root@nim /var/core # uncompress /var/core/core.8257538.18100246.Z
root@nim /var/core # /usr/lib/ras/check_core /var/core/core.8257538.18100246
/usr/lib/libc.a
/usr/lib/libiconv.a
/usr/lib/libcrypt.a
/usr/lib/nls/loc/en_US__64
/usr/lib/libi18n.a
/usr/ccs/bin/usla64
ksh93
aix/core_mgmt.1609532516.txt.gz · Last modified: 2021/01/01 21:21 by 127.0.0.1