Document sef's recent changes in the corefile naming.

Reviewed by:	sef (well, i believe his `Looks good' was a review result :)
This commit is contained in:
Joerg Wunsch 1998-07-21 18:16:16 +00:00
parent 991b3bc3b3
commit aa81f3a9d8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=37810
3 changed files with 37 additions and 15 deletions

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93
.\" $Id: sysctl.8,v 1.13 1997/08/30 02:28:00 kato Exp $
.\" $Id: sysctl.8,v 1.14 1997/10/20 12:53:54 charnier Exp $
.\"
.Dd September 23, 1994
.Dt SYSCTL 8
@ -140,6 +140,7 @@ privilege can change the value.
.It kern.update integer yes
.It kern.osreldate string no
.It kern.bootfile string yes
.It kern.corefile string yes
.It vm.loadavg struct no
.It hw.machine string no
.It hw.model string no

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)core.5 8.3 (Berkeley) 12/11/93
.\" $Id: core.5,v 1.5 1997/02/22 13:25:57 peter Exp $
.\" $Id: core.5,v 1.6 1998/05/11 03:41:51 steve Exp $
.\"
.Dd December 11, 1993
.Dt CORE 5
@ -46,7 +46,7 @@ also cause a record of the process's in-core state to be written
to disk for later examination by one of the available debuggers.
(See
.Xr sigaction 2 . )
This memory image is written to a file named
This memory image is written to a file named by default
.Nm programname.core
in the working directory;
provided the terminated process had write permission in the directory,
@ -55,15 +55,28 @@ a system crash.
(In this event, the decision to save the core file is arbitrary, see
.Xr savecore 8 . )
.Pp
The maximum size of a
.Nm programname.core
file is limited by
The maximum size of a core file is limited by
.Xr setrlimit 2 .
Files which would be larger than the limit are not created.
.Pp
The
.Nm programname.core
file consists of the
The name of the file is controlled via the
.Xr sysctl 8
variable
.Va kern.corefile .
The contents of this variable describes a filename to store
the core image to. This filename can be absolute, or relative (which
will resolve to the current working directory of the program
generating it). Any sequence of
.Em \&%N
in this filename template will be replaced by the process name,
.Em \&%P
by the processes PID, and
.Em \&%U
by the UID. The name defaults to
.Em \&%N.core ,
yielding the traditional FreeBSD behaviour.
.Pp
The core file consists of the
.Fa u .
area, whose size (in pages) is
defined by the
@ -76,12 +89,10 @@ area starts with a
.Fa user
structure as given in
.Aq Pa sys/user.h .
The remainder of the
.Nm programname.core
The remainder of the core
file consists of the data pages followed by
the stack pages of the process image.
The amount of data space image in the
.Nm programname.core
The amount of data space image in the core
file is given (in pages) by the
variable
.Fa u_dsize
@ -98,11 +109,20 @@ The size of a ``page'' is given by the constant
.Dv PAGE_SIZE
(also from
.Aq Pa sys/param.h ) .
.Sh EXAMPLES
In order to store all core images in per-user private areas under
.Pa /var/coredumps ,
the following
.Xr sysctl 8
command can be used:
.Pp
.Dl sysctl -w kern.corefile="/var/coredumps/\&%U/\&%N.core"
.Sh SEE ALSO
.Xr gdb 1 ,
.Xr kgdb 1 ,
.Xr setrlimit 2 ,
.Xr sigaction 2
.Xr sigaction 2 ,
.Xr sysctl 8
.Sh HISTORY
A
.Nm core

View File

@ -30,7 +30,7 @@
.\" SUCH DAMAGE.
.\"
.\" From: @(#)sysctl.8 8.1 (Berkeley) 6/6/93
.\" $Id: sysctl.8,v 1.13 1997/08/30 02:28:00 kato Exp $
.\" $Id: sysctl.8,v 1.14 1997/10/20 12:53:54 charnier Exp $
.\"
.Dd September 23, 1994
.Dt SYSCTL 8
@ -140,6 +140,7 @@ privilege can change the value.
.It kern.update integer yes
.It kern.osreldate string no
.It kern.bootfile string yes
.It kern.corefile string yes
.It vm.loadavg struct no
.It hw.machine string no
.It hw.model string no