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 2025B13888F for ; Sun, 4 Oct 2015 20:37:29 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2BB2AE077F; Sun, 4 Oct 2015 20:37:28 +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 CA761E077F for ; Sun, 4 Oct 2015 20:37:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9FBC6340A2B for ; Sun, 4 Oct 2015 20:37:25 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3D38A546 for ; Sun, 4 Oct 2015 20:37:23 +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: <1443821655.a59365a582c3a8c9a8b863b572fddcb65fccadfd.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: sh/ X-VCS-Repository: proj/openrc X-VCS-Files: sh/start-stop-daemon.sh X-VCS-Directories: sh/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: a59365a582c3a8c9a8b863b572fddcb65fccadfd X-VCS-Branch: master Date: Sun, 4 Oct 2015 20:37:23 +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: 8ab9dc7c-777e-42f3-99dc-599d7dc8d96e X-Archives-Hash: d322bfded7339b601a0131799c4980af commit: a59365a582c3a8c9a8b863b572fddcb65fccadfd Author: William Hubbs gmail com> AuthorDate: Fri Oct 2 21:34:15 2015 +0000 Commit: William Hubbs gentoo org> CommitDate: Fri Oct 2 21:34:15 2015 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=a59365a5 start-stop-daemon.sh: complain in start if command is undefined The default start-stop-daemon start function expects the command variable to be defined to point to the daemon we want to start. If the variable is undefined, this means that there will be nothing to start, and in this case we should complain because it is possible that the script writer made a typo in the variable name. sh/start-stop-daemon.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sh/start-stop-daemon.sh b/sh/start-stop-daemon.sh index 6a3e205..ea99269 100644 --- a/sh/start-stop-daemon.sh +++ b/sh/start-stop-daemon.sh @@ -4,7 +4,13 @@ ssd_start() { - [ -n "$command" ] || return 0 + if [ -z "$command" ]; then + ewarn "The command variable is undefined." + ewarn "There is nothing for ${name:-$RC_SVCNAME} to start." + ewarn "If this is what you intend, please write a start function." + ewarn "This will become a failure in a future release." + return 0 + fi local _background= ebegin "Starting ${name:-$RC_SVCNAME}"