From a92fa815a60a804cdecd13d630d1aca84a2807cd Mon Sep 17 00:00:00 2001 From: julian Date: Sat, 24 Aug 1996 01:40:02 +0000 Subject: Add support to halt, to allow it to request that the power be turned off (the RB_POWEROFF flag) --- sbin/reboot/reboot.8 | 16 ++++++++++++---- sbin/reboot/reboot.c | 8 ++++++-- 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'sbin') 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; -- cgit v1.1