Open desktop mechanic

cat /dev/random | grep "For being ignorant to whom it goes I writ at random, very doubtfully"

Enabling core files on the Java Desktop System

Friday May 20, 2005

My wife thought "Kernel Core Dump Analysis", the title of a course I took here, sounded like something a janitorial detective would do after Wisconsin state fair. Kernel core files can be used to diagnose problems with the kernel, though I must admit that I can't remember the last time I saw a Solaris or linux kernel crash. Application core files can be used to diagnose application crashes, but they are not be enabled by default in many GNU/linux distributions.

To enable core files on Java Desktop System on Linux:
1) Edit /etc/profile with gedit, vi or your favorite editor.

uncomment this line:
    ulimit -c 20000             # only core-files less than 20 MB are written

comment out this line:
#   ulimit -Sc 0                # don't create core files 
Now you have to make sure the application can write core files in the process's current working directory. To find the working directory of the process:
2) Get Process ID:
ps -e | grep {process name}

3) Find process's working diretory: 
ls -l /proc/{pid of process}/cwd

4) chmod the working directory to allow the process to write a core file there.  
Note for processes such as gconfd-2 which use '/' as their working directory, 
you might have to do something really horrible such as 'chmod 777 /'.  Yuck.

5) reboot
To enable core files for Java Desktop System 3 on Solaris:
Use coreadm
1) coreadm -e global -g /var/tmp/core.%f.%p
2) There is no step 2.
P.S. If you want to look at a core file without crashing your application, have a look at Solaris gcore(1).

Update:Added "-e global" flag to coreadm ensures that global core files are enabled.

[3] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg