Add a "-d" option which causes the system to generate a crash dump.
This commit is contained in:
parent
ddc83e8523
commit
85c981cc3f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=53523
@ -44,11 +44,11 @@ stopping and restarting the system
|
|||||||
.Nm halt
|
.Nm halt
|
||||||
.Op Fl nqp
|
.Op Fl nqp
|
||||||
.Nm reboot
|
.Nm reboot
|
||||||
.Op Fl nqp
|
.Op Fl dnqp
|
||||||
.Nm fasthalt
|
.Nm fasthalt
|
||||||
.Op Fl nqp
|
.Op Fl nqp
|
||||||
.Nm fastboot
|
.Nm fastboot
|
||||||
.Op Fl nqp
|
.Op Fl dnqp
|
||||||
.Sh DESCRIPTION
|
.Sh DESCRIPTION
|
||||||
The
|
The
|
||||||
.Nm halt
|
.Nm halt
|
||||||
@ -66,6 +66,11 @@ file.
|
|||||||
.Pp
|
.Pp
|
||||||
The options are as follows:
|
The options are as follows:
|
||||||
.Bl -tag -width indent
|
.Bl -tag -width indent
|
||||||
|
.It Fl d
|
||||||
|
The system is requested to create a crash dump. This option is
|
||||||
|
supported only when rebooting, and it has no effect unless a dump
|
||||||
|
device has previously been specified with
|
||||||
|
.Xr dumpon 8 .
|
||||||
.It Fl n
|
.It Fl n
|
||||||
The file system cache is not flushed.
|
The file system cache is not flushed.
|
||||||
This option should probably not be used.
|
This option should probably not be used.
|
||||||
@ -101,6 +106,8 @@ specific programs.
|
|||||||
.Sh SEE ALSO
|
.Sh SEE ALSO
|
||||||
.Xr wtmp 5 ,
|
.Xr wtmp 5 ,
|
||||||
.Xr boot 8 ,
|
.Xr boot 8 ,
|
||||||
|
.Xr dumpon 8 ,
|
||||||
|
.Xr savecore 8 ,
|
||||||
.Xr shutdown 8 ,
|
.Xr shutdown 8 ,
|
||||||
.Xr sync 8
|
.Xr sync 8
|
||||||
.Sh HISTORY
|
.Sh HISTORY
|
||||||
|
@ -77,8 +77,11 @@ main(argc, argv)
|
|||||||
} else
|
} else
|
||||||
howto = 0;
|
howto = 0;
|
||||||
lflag = nflag = qflag = 0;
|
lflag = nflag = qflag = 0;
|
||||||
while ((ch = getopt(argc, argv, "lnpq")) != -1)
|
while ((ch = getopt(argc, argv, "dlnpq")) != -1)
|
||||||
switch(ch) {
|
switch(ch) {
|
||||||
|
case 'd':
|
||||||
|
howto |= RB_DUMP;
|
||||||
|
break;
|
||||||
case 'l': /* Undocumented; used by shutdown. */
|
case 'l': /* Undocumented; used by shutdown. */
|
||||||
lflag = 1;
|
lflag = 1;
|
||||||
break;
|
break;
|
||||||
@ -100,6 +103,8 @@ main(argc, argv)
|
|||||||
argc -= optind;
|
argc -= optind;
|
||||||
argv += optind;
|
argv += optind;
|
||||||
|
|
||||||
|
if ((howto & (RB_DUMP | RB_HALT)) == (RB_DUMP | RB_HALT))
|
||||||
|
errx(1, "cannot dump (-d) when halting; must reboot instead");
|
||||||
if (geteuid()) {
|
if (geteuid()) {
|
||||||
errno = EPERM;
|
errno = EPERM;
|
||||||
err(1, NULL);
|
err(1, NULL);
|
||||||
@ -181,6 +186,7 @@ main(argc, argv)
|
|||||||
void
|
void
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
(void)fprintf(stderr, "usage: %s [-npq]\n", dohalt ? "halt" : "reboot");
|
(void)fprintf(stderr, "usage: %s [-dnpq]\n",
|
||||||
|
dohalt ? "halt" : "reboot");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user