HP-UX Reference (11i v3 07/02) - 1M System Administration Commands A-M (vol 3)

c
coreadm(1M) coreadm(1M)
-p pattern Set the per-process core file name pattern to pattern for each of the specified process-ID’s.
The pattern can contain any of the special variables described in DESCRIPTION and need
not begin with
/. If it does not begin with
/, the core file name will be evaluated relative
to the current working directory at the time of core file creation.
This option can be used by non-privileged users to specify core file settings for processes
owned by that user. Super-users can apply it to any process. The per-process core file will
be inherited by the future child processes of the affected processes. See fork(2). This
option, when invoked without a PID will apply the settings to the calling process (usually
the invoking shell).
-E command [arguments]
This option is used in conjunction with -p
pattern. The -E option will execute the com-
mand specified with the per-process pattern that was specified with
-p.
-P {enable|disable}[pid...]
This option can be used to enable or disable core file creation for the target process. As an
example, a user may choose to add the
coreadm -P $$ disable in the shell startup
script to avoid creation of core files by that user.
EXAMPLES
The following examples assume that the user has appropriate privilege.
1. To examine the current core file settings:
$ coreadm
global core file pattern:
init(1M) core file pattern:
global core dumps: disabled
per-process core dumps: enabled
global setid core dumps: disabled
per-process setid core dumps: disabled
2. Set global core file settings to include process-ID and machine name and place the core file in the loca-
tion
/mnt/cores .
$ coreadm -e global -g /mnt/cores/core.%p.%n
A process with PID 1777 on the machine breaker will generate a core file in
/mnt/cores as
core.1777.breaker
(in addition to the core file generated in the CWD of PID 1777).
3. Examine the per process core file settings for process-IDs 1777 and 1778
$ coreadm 1777 1778
1777: core.%p.%u
1778: /nethome/gandalf/core/core.%f.%p.%t
4. A user can disable creation of core les completely by specifying in the shell startup file (for example,
.profile).
$ coreadm -P disable $$
$ coreadm $$
1157: (Disabled)
WARNINGS
The output format of coreadm may change without notice. Applications parsing the coreadm output,
should not rely on the compatibility of the output format between releases.
SEE ALSO
umask(1), init(1M), coreadm(2), core(4).
HP-UX 11i Version 3: February 2007 2 Hewlett-Packard Company 127