From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 9D43A139694 for ; Mon, 10 Jul 2017 23:37:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 116F12340C4; Mon, 10 Jul 2017 23:37:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E1C932340C4 for ; Mon, 10 Jul 2017 23:37:22 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0CC21341879 for ; Mon, 10 Jul 2017 23:37:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7152B744B for ; Mon, 10 Jul 2017 23:37:15 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1499729784.9812ce5b8dc22fe36cc7bf75cf6e62db204ece3d.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: scripts/ X-VCS-Repository: proj/openrc X-VCS-Files: scripts/halt.in X-VCS-Directories: scripts/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 9812ce5b8dc22fe36cc7bf75cf6e62db204ece3d X-VCS-Branch: master Date: Mon, 10 Jul 2017 23:37:15 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: f6a92f5b-a643-45bc-9c63-b0ced022969e X-Archives-Hash: 15cbebe4d9c9a1ed7906adc5ba49c7dc commit: 9812ce5b8dc22fe36cc7bf75cf6e62db204ece3d Author: William Hubbs gmail com> AuthorDate: Mon Jul 10 23:23:01 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Jul 10 23:36:24 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=9812ce5b fix halt wrapper so it is sysvinit compatible This makes the halt wrapper sysvinit compatible. It ignores several command line switches which are not currently implemented; however, those can be implemented if we need to do so. This fixes https://github.com/openrc/openrc/issues/146. scripts/halt.in | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/scripts/halt.in b/scripts/halt.in index 68b13be1..257cc2a7 100644 --- a/scripts/halt.in +++ b/scripts/halt.in @@ -1,3 +1,24 @@ #!@SHELL@ -exec @SBINDIR@/openrc-shutdown --halt "$@" +option_arg= +poweroff_arg= +while getopts :nwdfiph opt; do + case "$opt" in + n) ;; + w) poweroff_arg=--write-only ;; + d) option_arg=--no-write ;; + f) ;; + i) ;; + p) poweroff_arg=--poweroff ;; + [?]) printf "%s\n" "${0##*/}: invalid command line option" >&2 + exit 1 + ;; + esac +done +shift $((OPTIND-1)) + +if [ -z "${poweroff_arg}" ]; then + poweroff_arg=--poweroff +fi + +exec @SBINDIR@/openrc-shutdown ${option_arg} ${poweroff_arg} "$@"