summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sbin/reboot/reboot.816
-rw-r--r--sbin/reboot/reboot.c8
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;
OpenPOWER on IntegriCloud