diff options
author | 1997-07-25 04:45:53 +0000 | |
---|---|---|
committer | 1997-07-25 04:45:53 +0000 | |
commit | 891a04fba53c906154cbb17e93f87f31e7a212ea (patch) | |
tree | d2c00bd0eac0215e58d0b935792fba43fa0cfe3f | |
parent | add SysV shared mem for X (diff) | |
download | wireguard-openbsd-891a04fba53c906154cbb17e93f87f31e7a212ea.tar.xz wireguard-openbsd-891a04fba53c906154cbb17e93f87f31e7a212ea.zip |
do -d for reboot and halt
-rw-r--r-- | sbin/shutdown/shutdown.8 | 6 | ||||
-rw-r--r-- | sbin/shutdown/shutdown.c | 23 |
2 files changed, 19 insertions, 10 deletions
diff --git a/sbin/shutdown/shutdown.8 b/sbin/shutdown/shutdown.8 index 0e3113650e2..519ccc6bdc2 100644 --- a/sbin/shutdown/shutdown.8 +++ b/sbin/shutdown/shutdown.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: shutdown.8,v 1.3 1997/06/22 22:29:05 downsj Exp $ +.\" $OpenBSD: shutdown.8,v 1.4 1997/07/25 04:45:53 mickey Exp $ .\" $NetBSD: shutdown.8,v 1.6 1995/03/18 15:01:07 cgd Exp $ .\" .\" Copyright (c) 1988, 1991, 1993 @@ -43,7 +43,7 @@ .Sh SYNOPSIS .Nm shutdown .Op Fl -.Op Fl fhkrnp +.Op Fl dfhkrnp .Ar time .Op Ar warning-message ... .Sh DESCRIPTION @@ -56,6 +56,8 @@ would otherwise not bother with such niceties. Available friendlinesses: .Bl -tag -width time .It Fl f +The system will drop crash dump. +.It Fl f .Nm Shutdown arranges, in the manner of .Xr fastboot 8 , diff --git a/sbin/shutdown/shutdown.c b/sbin/shutdown/shutdown.c index aa7698c83d5..986d0a8e970 100644 --- a/sbin/shutdown/shutdown.c +++ b/sbin/shutdown/shutdown.c @@ -1,4 +1,4 @@ -/* $OpenBSD: shutdown.c,v 1.10 1997/07/25 01:26:47 mickey Exp $ */ +/* $OpenBSD: shutdown.c,v 1.11 1997/07/25 04:45:53 mickey Exp $ */ /* $NetBSD: shutdown.c,v 1.9 1995/03/18 15:01:09 cgd Exp $ */ /* @@ -44,7 +44,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)shutdown.c 8.2 (Berkeley) 2/16/94"; #else -static char rcsid[] = "$OpenBSD: shutdown.c,v 1.10 1997/07/25 01:26:47 mickey Exp $"; +static char rcsid[] = "$OpenBSD: shutdown.c,v 1.11 1997/07/25 04:45:53 mickey Exp $"; #endif #endif /* not lint */ @@ -98,7 +98,7 @@ struct interval { #undef S static time_t offset, shuttime; -static int dofast, dohalt, doreboot, dopower, killflg, mbuflen, nosync; +static int dofast, dohalt, doreboot, dopower, dodump, killflg, mbuflen, nosync; static char *whom, mbuf[BUFSIZ]; void badtime __P((void)); @@ -129,11 +129,14 @@ main(argc, argv) } #endif readstdin = 0; - while ((ch = getopt(argc, argv, "-fhknpr")) != -1) + while ((ch = getopt(argc, argv, "-dfhknpr")) != -1) switch (ch) { case '-': readstdin = 1; break; + case 'd': + dodump = 1; + break; case 'f': dofast = 1; break; @@ -372,18 +375,22 @@ die_you_gravy_sucking_pig_dog() (void)printf(" no sync"); if (dofast) (void)printf(" no fsck"); + if (dodump) + (void)printf(" with dump"); (void)printf("\nkill -HUP 1\n"); #else if (doreboot) { - execle(_PATH_REBOOT, "reboot", "-l", (nosync ? "-n" : NULL), - NULL, NULL); + execle(_PATH_REBOOT, "reboot", "-l", + (nosync ? "-n" : (dodump ? "-d" : NULL)), + (dodump ? "-d" : NULL), NULL, NULL); syslog(LOG_ERR, "shutdown: can't exec %s: %m.", _PATH_REBOOT); perror("shutdown"); } else if (dohalt) { execle(_PATH_HALT, "halt", "-l", - (dopower ? "-p" : (nosync ? "-n" : NULL)), - (nosync ? "-n" : NULL), NULL, NULL); + (dopower ? "-p" : (nosync ? "-n" : (dodump ? "-d" : NULL))), + (nosync ? "-n" : (dodump ? "-d" : NULL)), + (dodump ? "-d" : NULL), NULL, NULL); syslog(LOG_ERR, "shutdown: can't exec %s: %m.", _PATH_HALT); perror("shutdown"); } |