xref: /original-bsd/sbin/savecore/savecore.8 (revision 33586e34)
Copyright (c) 1980 The Regents of the University of California.
All rights reserved.

Redistribution and use in source and binary forms are permitted
provided that the above copyright notice and this paragraph are
duplicated in all such forms and that any documentation,
advertising materials, and other materials related to such
distribution and use acknowledge that the software was developed
by the University of California, Berkeley. The name of the
University may not be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.

@(#)savecore.8 6.4 (Berkeley) 10/31/88

SAVECORE 8 ""
C 4
NAME
savecore - save a core dump of the operating system
SYNOPSIS
/etc/savecore dirname [ system ]
DESCRIPTION
Savecore is meant to be called near the end of the /etc/rc file. Its function is to save the core dump of the system (assuming one was made) and to write a reboot message in the shutdown log.

Savecore checks the core dump to be certain it corresponds with the current running unix. If it does it saves the core image in the file dirname /vmcore.n and its brother, the namelist, dirname /vmunix.n The trailing ".n" in the pathnames is replaced by a number which grows every time savecore is run in that directory.

Before savecore writes out a core image, it reads a number from the file dirname /minfree. If the number of free kilobytes on the filesystem which contains dirname is less than the number obtained from the minfree file, the core dump is not saved. If the minfree file does not exist, savecore always writes out the core file (assuming that a core dump was taken).

Savecore also logs a reboot message using facility LOG_AUTH (see syslog (3)) If the system crashed as a result of a panic, savecore logs the panic string too.

If the core dump was from a system other than /vmunix, the name of that system must be supplied as sysname .

FILES
/vmunix current UNIX
BUGS
Can be fooled into thinking a core dump is the wrong size.