Generating/enabling core files

 Solaris OS

  • Using command line : /usr/bin/coreadm (coreadm(1M))
    • #coreadm -e log (activate console warning message)
    • #coreadm -e process
    • #coreadm -G all
    • #coreadm -i /var/tmp/core.%f.%p.%t
    • #coreadm -g /var/tmp/core.%f.%p.%t
    • #coreadm -e global
  • Per process configuration 

#coreadm -p /var/tmp/core.%f.%p 1209


crash of process 1209 will generate the file “/var/tmp/core.<progam name>.1209”


  • Using the configuration file : /etc/coreadm.conf 

COREADM_GLOB_PATTERN=/var/tmp/core.%f.%u.%p.%t
COREADM_INIT_PATTERN=/var/tmp/core.%f.%u.%p.%t
COREADM_GLOB_ENABLED=no
COREADM_PROC_ENABLED=yes
COREADM_GLOB_SETID_ENABLED=yes
COREADM_PROC_SETID_ENABLED=yes
COREADM_GLOB_LOG_ENABLED=yes

You then synchronise the system configuration with configuration file using coreadm -u

Linux OS 

  • Generate a core of a running process 

/usr/bin/gcore (gcore(1))
/usr/bin/gcore [-o filename] <process id>
exemple : /usr/bin/gcore -o /var/tmp/my_core_file 1209

  • set core file limit in /etc/profile. 
Replace any line like 
ulimit -S -c 0 > /dev/null 2>&1
by something like
[ `/usr/bin/id -u` -eq 0 ] && ulimit -c unlimited
  • set core file pattern (cf proc(5) fro details)

echo 1 > /proc/sys/kernel/core_uses_pid

echo /var/tmp/core.%f.%p.%t > /proc/sys/kernel/core_pattern
you can also use the systctl command :
sysctl -w kernel.core_pattern=/var/tmp/core.%f.%p.%t
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Emmanuel Jannetti blog

Search

Archives
« avril 2014
lun.mar.mer.jeu.ven.sam.dim.
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today