From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 260001392EF for ; Wed, 9 Jul 2014 20:39:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 76E72E08E5; Wed, 9 Jul 2014 20:39:24 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 14E57E08E5 for ; Wed, 9 Jul 2014 20:39:24 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 399B433FF01 for ; Wed, 9 Jul 2014 20:39:23 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 27983193E5 for ; Wed, 9 Jul 2014 20:39:21 +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: <1404938028.57b9e601a97fac3a044ec5d7e5f11b6219c892b7.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: init.d/ X-VCS-Repository: proj/openrc X-VCS-Files: init.d/local.in X-VCS-Directories: init.d/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 57b9e601a97fac3a044ec5d7e5f11b6219c892b7 X-VCS-Branch: master Date: Wed, 9 Jul 2014 20:39:21 +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: adb716ad-1a0b-4bbb-851f-9182deb9409d X-Archives-Hash: 92c10549f0e03361e52e97e14e0974bf commit: 57b9e601a97fac3a044ec5d7e5f11b6219c892b7 Author: William Hubbs gmail com> AuthorDate: Sat Jul 5 19:30:33 2014 +0000 Commit: William Hubbs gentoo org> CommitDate: Wed Jul 9 20:33:48 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=57b9e601 init.d/local: bring functioning more in line with how sysctl works - remove the has_executables variable since it isn't used. - Convert the conditional calls to ewend/vewend to a single call to veend. - Always call eend after all scripts are executed passing the appropriate error code. Because of this change, you will see only an overall status when starting or stopping local unless you are using verbose mode. --- init.d/local.in | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/init.d/local.in b/init.d/local.in index 06be25f..180735d 100644 --- a/init.d/local.in +++ b/init.d/local.in @@ -14,20 +14,17 @@ start() { ebegin "Starting local" - local file has_errors retval + local file has_errors=0 retval eindent for file in @SYSCONFDIR@/local.d/*.start; do if [ -x "${file}" ]; then - has_executables=1 vebegin "Executing \"${file}\"" "${file}" 2>&1 >/dev/null retval=$? if [ ${retval} -ne 0 ]; then has_errors=1 - ewend ${retval} "Execution of \"${file}\" failed." - else - vewend 0 fi + veend ${retval} "Execution of \"${file}\" failed." fi done eoutdent @@ -40,9 +37,7 @@ start() local_start fi - if [ -z "${has_errors}" ]; then - eend 0 - fi + eend ${has_errors} # We have to end with a zero exit code, because a failed execution # of an executable @SYSCONFDIR@/local.d/*.start file shouldn't result in @@ -57,20 +52,17 @@ stop() { ebegin "Stopping local" - local file has_errors retval + local file has_errors=0 retval eindent for file in @SYSCONFDIR@/local.d/*.stop; do if [ -x "${file}" ]; then - has_executables=1 vebegin "Executing \"${file}\"" "${file}" 2>&1 >/dev/null retval=$? if [ ${retval} -ne 0 ]; then has_errors=1 - ewend ${retval} "Execution of \"${file}\" failed." - else - vewend 0 fi + veend ${retval} "Execution of \"${file}\" failed." fi done eoutdent @@ -83,9 +75,7 @@ stop() local_stop fi - if [ -z "${has_errors}" ]; then - eend 0 - fi + eend ${has_errors} # An executable @SYSCONFDIR@/local.d/*.stop file which failed with a # non-zero exit status is not a reason to mark this service