diff options
author | julian <julian@FreeBSD.org> | 1996-08-24 01:40:02 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 1996-08-24 01:40:02 +0000 |
commit | a92fa815a60a804cdecd13d630d1aca84a2807cd (patch) | |
tree | cf586bd947d081eaf61fb5ae6d419415f577e256 /sbin | |
parent | 4a6f54f391cee4d1a7c50b6aa3d75c0dab417c49 (diff) | |
download | FreeBSD-src-a92fa815a60a804cdecd13d630d1aca84a2807cd.zip FreeBSD-src-a92fa815a60a804cdecd13d630d1aca84a2807cd.tar.gz |
Add support to halt, to allow it to request that the power be turned off
(the RB_POWEROFF flag)
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/reboot/reboot.8 | 16 | ||||
-rw-r--r-- | sbin/reboot/reboot.c | 8 |
2 files changed, 18 insertions, 6 deletions
diff --git a/sbin/reboot/reboot.8 b/sbin/reboot/reboot.8 index 3d2d7e7..6252093 100644 --- a/sbin/reboot/reboot.8 +++ b/sbin/reboot/reboot.8 @@ -41,13 +41,13 @@ stopping and restarting the system .Sh SYNOPSIS .Nm halt -.Op Fl nq +.Op Fl nqp .Nm reboot -.Op Fl nq +.Op Fl nqp .Nm fasthalt -.Op Fl nq +.Op Fl nqp .Nm fastboot -.Op Fl nq +.Op Fl nqp .Sh DESCRIPTION The .Nm halt @@ -74,6 +74,14 @@ 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 p +If the +.Fl p +option is specified, then the system will turn off the power +if it can. This is of course likely to make +.Nm reboot +rather similar to +.Nm halt. .El .Pp The diff --git a/sbin/reboot/reboot.c b/sbin/reboot/reboot.c index 6d0fee4..66e5398 100644 --- a/sbin/reboot/reboot.c +++ b/sbin/reboot/reboot.c @@ -63,7 +63,7 @@ main(argc, argv) { register int i; struct passwd *pw; - int ch, howto, lflag, nflag, qflag, sverrno; + int ch, howto, lflag, nflag, qflag, pflag, sverrno; char *p, *user; if (strstr((p = rindex(*argv, '/')) ? p + 1 : *argv, "halt")) { @@ -72,7 +72,7 @@ main(argc, argv) } else howto = 0; lflag = nflag = qflag = 0; - while ((ch = getopt(argc, argv, "lnq")) != EOF) + while ((ch = getopt(argc, argv, "lnpq")) != EOF) switch(ch) { case 'l': /* Undocumented; used by shutdown. */ lflag = 1; @@ -81,6 +81,10 @@ main(argc, argv) nflag = 1; howto |= RB_NOSYNC; break; + case 'p': + pflag = 1; + howto |= (RB_POWEROFF | RB_HALT); + break; case 'q': qflag = 1; break; |