Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/openrc:master commit in: sh/
Date: Sun, 04 Oct 2015 20:37:29
Message-Id: 1443821655.a59365a582c3a8c9a8b863b572fddcb65fccadfd.williamh@OpenRC
1 commit: a59365a582c3a8c9a8b863b572fddcb65fccadfd
2 Author: William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
3 AuthorDate: Fri Oct 2 21:34:15 2015 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Fri Oct 2 21:34:15 2015 +0000
6 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=a59365a5
7
8 start-stop-daemon.sh: complain in start if command is undefined
9
10 The default start-stop-daemon start function expects the command
11 variable to be defined to point to the daemon we want to start.
12
13 If the variable is undefined, this means that there will be nothing to
14 start, and in this case we should complain because it is possible that
15 the script writer made a typo in the variable name.
16
17 sh/start-stop-daemon.sh | 8 +++++++-
18 1 file changed, 7 insertions(+), 1 deletion(-)
19
20 diff --git a/sh/start-stop-daemon.sh b/sh/start-stop-daemon.sh
21 index 6a3e205..ea99269 100644
22 --- a/sh/start-stop-daemon.sh
23 +++ b/sh/start-stop-daemon.sh
24 @@ -4,7 +4,13 @@
25
26 ssd_start()
27 {
28 - [ -n "$command" ] || return 0
29 + if [ -z "$command" ]; then
30 + ewarn "The command variable is undefined."
31 + ewarn "There is nothing for ${name:-$RC_SVCNAME} to start."
32 + ewarn "If this is what you intend, please write a start function."
33 + ewarn "This will become a failure in a future release."
34 + return 0
35 + fi
36
37 local _background=
38 ebegin "Starting ${name:-$RC_SVCNAME}"