public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "William Hubbs" <williamh@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/openrc:master commit in: man/, src/rc/
Date: Mon, 22 May 2017 17:54:11 +0000 (UTC)	[thread overview]
Message-ID: <1495473315.0cfd0dd9ef580ed9dc563ccc164d70efe8f299db.williamh@OpenRC> (raw)

commit:     0cfd0dd9ef580ed9dc563ccc164d70efe8f299db
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Mon May 22 17:15:15 2017 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Mon May 22 17:15:15 2017 +0000
URL:        https://gitweb.gentoo.org/proj/openrc.git/commit/?id=0cfd0dd9

openrc-shutdown: move to single user mode by default

To be more compatible with sysvinit, move to single user mode if no
options are specified on the command line.

 man/openrc-shutdown.8    | 5 ++++-
 src/rc/openrc-shutdown.c | 4 +++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/man/openrc-shutdown.8 b/man/openrc-shutdown.8
index eae16ae8..d0e95e24 100644
--- a/man/openrc-shutdown.8
+++ b/man/openrc-shutdown.8
@@ -8,7 +8,7 @@
 .\" This file may not be copied, modified, propagated, or distributed
 .\"    except according to the terms contained in the LICENSE file.
 .\"
-.Dd April 6, 2017
+.Dd May 22, 2017
 .Dt openrc-shutdown 8 SMM
 .Os OpenRC
 .Sh NAME
@@ -40,6 +40,9 @@ upgrade of OpenRC if you are using openrc-init as your init process.
 .It Fl r , -reboot
 Stop all services, kill all processes and reboot the system.
 .El
+.Pp
+If none of these options are given, the default is to move the system
+into single user mode.
 .Sh SEE ALSO
 .Xr openrc-init 8 ,
 .Xr kexec 8 ,

diff --git a/src/rc/openrc-shutdown.c b/src/rc/openrc-shutdown.c
index 8905d354..0ed77445 100644
--- a/src/rc/openrc-shutdown.c
+++ b/src/rc/openrc-shutdown.c
@@ -114,7 +114,7 @@ if (geteuid() != 0)
 		case_RC_COMMON_GETOPT
 		}
 	}
-	if (cmd_count != 1) {
+	if (cmd_count > 1) {
 		eerror("%s: %s\n", applet, exclusive);
 		usage(EXIT_FAILURE);
 	}
@@ -128,5 +128,7 @@ if (geteuid() != 0)
 		send_cmd("reboot");
 	else if (do_reexec)
 		send_cmd("reexec");
+	else
+		send_cmd("single");
 	return 0;
 }


             reply	other threads:[~2017-05-22 17:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-22 17:54 William Hubbs [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-05-15 22:11 [gentoo-commits] proj/openrc:master commit in: man/, src/rc/ William Hubbs
2018-05-15  0:11 William Hubbs
2017-05-22 17:54 William Hubbs
2017-04-12 22:57 William Hubbs
2016-01-28 19:08 William Hubbs
2014-01-18  7:56 William Hubbs
2013-05-02 18:58 William Hubbs
2013-04-28 18:04 William Hubbs
2012-01-26 20:51 William Hubbs
2012-01-15  1:11 Christian Ruppert
2012-01-10  3:22 Robin H. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1495473315.0cfd0dd9ef580ed9dc563ccc164d70efe8f299db.williamh@OpenRC \
    --to=williamh@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox