1coreadm(1M) System Administration Commands coreadm(1M)
2
3
4
6 coreadm - core file administration
7
9 coreadm [-g pattern] [-G content] [-i pattern] [-I content]
10 [-d option]... [-e option]...
11
12
13 coreadm [-p pattern] [-P content] [pid]...
14
15
17 coreadm specifies the name and location of core files produced by
18 abnormally-terminating processes. See core(4).
19
20
21 Only users and roles that belong to the "Maintenance and Repair" RBAC
22 profile can execute the first form of the SYNOPSIS. This form config‐
23 ures system-wide core file options, including a global core file name
24 pattern and a core file name pattern for the init(1M) process. All set‐
25 tings are saved persistently and will be applied at boot.
26
27
28 Non-privileged users can execute the second form of the SYNOPSIS. This
29 form specifies the file name pattern and core file content that the
30 operating system uses to generate a per-process core file.
31
32
33 A core file name pattern is a normal file system path name with embed‐
34 ded variables, specified with a leading % character. The variables are
35 expanded from values that are effective when a core file is generated
36 by the operating system. The possible embedded variables are as fol‐
37 lows:
38
39 %d
40
41 Executable file directory name, up to a maximum of MAXPATHLEN char‐
42 acters
43
44
45 %f
46
47 Executable file name, up to a maximum of MAXCOMLEN characters
48
49
50 %g
51
52 Effective group-ID
53
54
55 %m
56
57 Machine name (uname -m)
58
59
60 %n
61
62 System node name (uname -n)
63
64
65 %p
66
67 Process-ID
68
69
70 %t
71
72 Decimal value of time(2)
73
74
75 %u
76
77 Effective user-ID
78
79
80 %z
81
82 Name of the zone in which process executed (zonename)
83
84
85 %%
86
87 Literal %
88
89
90
91 For example, the core file name pattern /var/cores/core.%f.%p would
92 result, for command foo with process-ID 1234, in the core file name
93 /var/cores/core.foo.1234.
94
95
96 A core file content description is specified using a series of tokens
97 to identify parts of a process's binary image:
98
99 anon
100
101 Anonymous private mappings, including thread stacks that are not
102 main thread stacks
103
104
105 ctf
106
107 CTF type information sections for loaded object files
108
109
110 data
111
112 Writable private file mappings
113
114
115 dism
116
117 DISM mappings
118
119
120 heap
121
122 Process heap
123
124
125 ism
126
127 ISM mappings
128
129
130 rodata
131
132 Read-only private file mappings
133
134
135 shanon
136
137 Anonymous shared mappings
138
139
140 shfile
141
142 Shared mappings that are backed by files
143
144
145 shm
146
147 System V shared memory
148
149
150 stack
151
152 Process stack
153
154
155 symtab
156
157 Symbol table sections for loaded object files
158
159
160 text
161
162 Readable and executable private file mappings
163
164
165
166 In addition, you can use the token all to indicate that core files
167 should include all of these parts of the process's binary image. You
168 can use the token none to indicate that no mappings are to be included.
169 The default token indicates inclusion of the system default content
170 (stack+heap+shm+ism+dism+text+data+rodata+anon+shanon+ctf+symtab). The
171 /proc file system data structures are always present in core files
172 regardless of the mapping content.
173
174
175 You can use + and - to concatenate tokens. For example, the core file
176 content default-ism would produce a core file with the default set of
177 mappings without any intimate shared memory mappings.
178
179
180 The coreadm command with no arguments reports the current system con‐
181 figuration, for example:
182
183 $ coreadm
184 global core file pattern: /var/cores/core.%f.%p
185 global core file content: all
186 init core file pattern: core
187 init core file content: default
188 global core dumps: enabled
189 per-process core dumps: enabled
190 global setid core dumps: enabled
191 per-process setid core dumps: disabled
192 global core dump logging: disabled
193
194
195
196
197 The coreadm command with only a list of process-IDs reports each
198 process's per-process core file name pattern, for example:
199
200 $ coreadm 278 5678
201 278: core.%f.%p default
202 5678: /home/george/cores/%f.%p.%t all-ism
203
204
205
206
207 Only the owner of a process or a user with the proc_owner privilege can
208 interrogate a process in this manner.
209
210
211 When a process is dumping core, up to three core files can be produced:
212 one in the per-process location, one in the system-wide global loca‐
213 tion, and, if the process was running in a local (non-global) zone, one
214 in the global location for the zone in which that process was running.
215 Each core file is generated according to the effective options for the
216 corresponding location.
217
218
219 When generated, a global core file is created in mode 600 and owned by
220 the superuser. Nonprivileged users cannot examine such files.
221
222
223 Ordinary per-process core files are created in mode 600 under the cre‐
224 dentials of the process. The owner of the process can examine such
225 files.
226
227
228 A process that is or ever has been setuid or setgid since its last
229 exec(2) presents security issues that relate to dumping core. Simi‐
230 larly, a process that initially had superuser privileges and lost those
231 privileges through setuid(2) also presents security issues that are
232 related to dumping core. A process of either type can contain sensitive
233 information in its address space to which the current nonprivileged
234 owner of the process should not have access. If setid core files are
235 enabled, they are created mode 600 and owned by the superuser.
236
238 The following options are supported:
239
240 -d option...
241
242 Disable the specified core file option. See the -e option for
243 descriptions of possible options.
244
245 Multiple -e and -d options can be specified on the command line.
246 Only users and roles belonging to the "Maintenance and Repair" RBAC
247 profile can use this option.
248
249
250 -e option...
251
252 Enable the specified core file option. Specify option as one of the
253 following:
254
255 global
256
257 Allow core dumps that use global core pattern.
258
259
260 global-setid
261
262 Allow set-id core dumps that use global core pattern.
263
264
265 log
266
267 Generate a syslog(3C) message when generation of a global core
268 file is attempted.
269
270
271 process
272
273 Allow core dumps that use per-process core pattern.
274
275
276 proc-setid
277
278 Allow set-id core dumps that use per-process core pattern.
279
280 Multiple -e and -d options can be specified on the command
281 line. Only users and roles belonging to the "Maintenance and
282 Repair" RBAC profile can use this option.
283
284
285
286 -g pattern
287
288 Set the global core file name pattern to pattern. The pattern must
289 start with a / and can contain any of the special % variables that
290 are described in the DESCRIPTION.
291
292 Only users and roles belonging to the "Maintenance and Repair" RBAC
293 profile can use this option.
294
295
296 -G content
297
298 Set the global core file content to content. You must specify con‐
299 tent by using the tokens that are described in the DESCRIPTION.
300
301 Only users and roles belonging to the "Maintenance and Repair" RBAC
302 profile can use this option.
303
304
305 -i pattern
306
307 Set the default per-process core file name to pattern. This changes
308 the per-process pattern for any process whose per-process pattern
309 is still set to the default. Processes that have had their per-
310 process pattern set or are descended from a process that had its
311 per-process pattern set (using the -p option) are unaffected. This
312 default persists across reboot.
313
314 Only users and roles belonging to the "Maintenance and Repair" RBAC
315 profile can use this option.
316
317
318 -I content
319
320 Set the default per-process core file content to content. This
321 changes the per-process content for any process whose per-process
322 content is still set to the default. Processes that have had their
323 per-process content set or are descended from a process that had
324 its per-process content set (using the -P option) are unaffected.
325 This default persists across reboot.
326
327 Only users and roles belonging to the "Maintenance and Repair" RBAC
328 profile can use this option.
329
330
331 -p pattern
332
333 Set the per-process core file name pattern to pattern for each of
334 the specified process-IDs. The pattern can contain any of the spe‐
335 cial % variables described in the DESCRIPTION and need not begin
336 with /. If the pattern does not begin with /, it is evaluated rela‐
337 tive to the directory that is current when the process generates a
338 core file.
339
340 A nonprivileged user can apply the -p option only to processes that
341 are owned by that user. A user with the proc_owner privilege can
342 apply the option to any process. The per-process core file name
343 pattern is inherited by future child processes of the affected pro‐
344 cesses. See fork(2).
345
346 If no process-IDs are specified, the -p option sets the per-process
347 core file name pattern to pattern on the parent process (usually
348 the shell that ran coreadm).
349
350
351 -P content
352
353 Set the per-process core file content to content for each of the
354 specified process-IDs. The content must be specified by using the
355 tokens that are described in the DESCRIPTION.
356
357 A nonprivileged user can apply the -p option only to processes that
358 are owned by that user. A user with the proc_owner privilege can
359 apply the option to any process. The per-process core file name
360 pattern is inherited by future child processes of the affected pro‐
361 cesses. See fork(2).
362
363 If no process-IDs are specified, the -P option sets the per-process
364 file content to content on the parent process (usually the shell
365 that ran coreadm).
366
367
369 The following operands are supported:
370
371 pid
372
373 process-ID
374
375
377 Example 1 Setting the Core File Name Pattern
378
379
380 When executed from a user's $HOME/.profile or $HOME/.login, the follow‐
381 ing command sets the core file name pattern for all processes that are
382 run during the login session:
383
384
385 example$ coreadm -p core.%f.%p
386
387
388
389
390 Note that since the process-ID is omitted, the per-process core file
391 name pattern will be set in the shell that is currently running and is
392 inherited by all child processes.
393
394
395 Example 2 Dumping a User's Files Into a Subdirectory
396
397
398 The following command dumps all of a user's core dumps into the core‐
399 files subdirectory of the home directory, discriminated by the system
400 node name. This command is useful for users who use many different
401 machines but have a shared home directory.
402
403
404 example$ coreadm -p $HOME/corefiles/%n.%f.%p 1234
405
406
407
408 Example 3 Culling the Global Core File Repository
409
410
411 The following commands set up the system to produce core files in the
412 global repository only if the executables were run from /usr/bin or
413 /usr/sbin.
414
415
416 example# mkdir -p /var/cores/usr/bin
417 example# mkdir -p /var/cores/usr/sbin
418 example# coreadm -G all -g /var/cores/%d/%f.%p.%n
419
420
421
423 /var/cores
424
425 Directory provided for global core file storage.
426
427
429 The following exit values are returned:
430
431 0
432
433 Successful completion.
434
435
436 1
437
438 A fatal error occurred while either obtaining or modifying the sys‐
439 tem core file configuration.
440
441
442 2
443
444 Invalid command-line options were specified.
445
446
448 See attributes(5) for descriptions of the following attributes:
449
450
451
452
453 ┌─────────────────────────────┬─────────────────────────────┐
454 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
455 ├─────────────────────────────┼─────────────────────────────┤
456 │Availability │SUNWcsu │
457 └─────────────────────────────┴─────────────────────────────┘
458
460 gcore(1), pfexec(1), svcs(1), init(1M), svcadm(1M), exec(2), fork(2),
461 setuid(2), time(2), syslog(3C), core(4), prof_attr(4), user_attr(4),
462 attributes(5), smf(5)
463
465 In a local (non-global) zone, the global settings apply to processes
466 running in that zone. In addition, the global zone's apply to processes
467 run in any zone.
468
469
470 The term global settings refers to settings which are applied to the
471 system or zone as a whole, and does not necessarily imply that the set‐
472 tings are to take effect in the global zone.
473
474
475 The coreadm service is managed by the service management facility,
476 smf(5), under the service identifier:
477
478 svc:/system/coreadm:default
479
480
481
482
483 Administrative actions on this service, such as enabling, disabling, or
484 requesting restart, can be performed using svcadm(1M). The service's
485 status can be queried using the svcs(1) command.
486
487
488 The -g, -G, -i, -I, -e, and -d options can be also used by a user,
489 role, or profile that has been granted both the solaris.smf.man‐
490 age.coreadm and solaris.smf.value.coreadm authorizations.
491
492
493
494SunOS 5.11 30 Sep 2008 coreadm(1M)