I am following the article
http://www.sun.com/bigadmin/content/submitted/per_process_path.jsp to enable the per-process core file on my Solaris 9 platform. But it seems not work for me. Here are the details:
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
----------
--
SunOS 5.9
login: user2
Password:
Last login: Thu Aug 28 11:04:38 from acartazk.ca.nor
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
$ coreadm
global core file pattern: /var/core/core.%f.%p
init core file pattern: core
global core dumps: enabled
per-process core dumps: enabled
global setid core dumps: enabled
per-process setid core dumps: enabled
global core dump logging: enabled
$ who am i
user2 pts/2 Aug 28 11:05 (acartazk.ca.nortel.com)
$ coreadm $$
663: /export/home/user2/corefil
es/core_%n
_%f_%u_%g_
%t_%p
$ ls -ld /export/home/user2/corefil
es
drwxr-xr-x 2 user2 other 512 Aug 27 18:01 /export/home/user2/corefil
es
$ ps -ef | grep user2
user2 673 663 0 11:06:28 pts/2 0:00 ps -ef
user2 674 663 0 11:06:28 pts/2 0:00 grep user2
user2 663 661 0 11:05:22 pts/2 0:00 -ksh
user2 592 590 0 10:52:51 pts/1 0:00 -ksh
$ gcore 663
gcore: core.663 dumped
$ pwd
/export/home/user2
$ ls -l
total 1250
-rw-r--r-- 1 user2 staff 203560 Aug 28 11:06 core.663
drwxr-xr-x 2 user2 other 512 Aug 27 18:01 corefiles
$ coreadm 663
663: /export/home/user2/corefil
es/core_%n
_%f_%u_%g_
%t_%p
$
--------------------------
----------
----------
----------
----------
----------
----------
----------
----------
------
Also I have a puzzle about the core file permission. The coreadm man page says:
When generated, a global core file will be created mode 600
and will be owned by the super-user. Non-privileged users
cannot examine such files.
Ordinary per-process core files are created mode 600 under
the credentials of the process. The owner of the process can
examine such files.
But the core generated by gcore has permission 644.