Add a `-d' option to force a dump. From John Kohl.

This commit is contained in:
mycroft 1995-10-05 05:36:21 +00:00
parent 0d889b54ba
commit fd25fd5a19
2 changed files with 17 additions and 7 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: reboot.8,v 1.2 1995/03/18 16:11:52 cgd Exp $
.\" $NetBSD: reboot.8,v 1.3 1995/10/05 05:36:21 mycroft Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -43,9 +43,9 @@
stopping and restarting the system
.Sh SYNOPSIS
.Nm halt
.Op Fl nq
.Op Fl nqd
.Nm reboot
.Op Fl nq
.Op Fl nqd
.Sh DESCRIPTION
The
.Nm halt
@ -72,6 +72,13 @@ option is specified,
the system is halted or restarted quickly and ungracefully, and only
the flushing of the file system cache is performed.
This option should probably not be used.
.It Fl d
If the
.Fl d
option is specified,
the system will create a dump before rebooting.
This option is useful for debugging system dump procedures or
capturing the state of a corrupted or misbehaving system.
.El
.Pp
Normally, the

View File

@ -1,4 +1,4 @@
/* $NetBSD: reboot.c,v 1.7 1995/03/18 16:11:54 cgd Exp $ */
/* $NetBSD: reboot.c,v 1.8 1995/10/05 05:36:22 mycroft Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)reboot.c 8.1 (Berkeley) 6/5/93";
#else
static char rcsid[] = "$NetBSD: reboot.c,v 1.7 1995/03/18 16:11:54 cgd Exp $";
static char rcsid[] = "$NetBSD: reboot.c,v 1.8 1995/10/05 05:36:22 mycroft Exp $";
#endif
#endif /* not lint */
@ -78,7 +78,7 @@ main(argc, argv)
} else
howto = 0;
lflag = nflag = qflag = 0;
while ((ch = getopt(argc, argv, "lnq")) != EOF)
while ((ch = getopt(argc, argv, "lnqd")) != EOF)
switch(ch) {
case 'l': /* Undocumented; used by shutdown. */
lflag = 1;
@ -90,6 +90,9 @@ main(argc, argv)
case 'q':
qflag = 1;
break;
case 'd':
howto |= RB_DUMP;
break;
case '?':
default:
usage();
@ -176,7 +179,7 @@ restart:
void
usage()
{
(void)fprintf(stderr, "usage: %s [-nq]\n", dohalt ? "halt" : "reboot");
(void)fprintf(stderr, "usage: %s [-nqd]\n", dohalt ? "halt" : "reboot");
exit(1);
}