aboutsummaryrefslogtreecommitdiff
path: root/sh/start-stop-daemon.sh
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2015-10-02 16:34:15 -0500
committerWilliam Hubbs <w.d.hubbs@gmail.com>2015-10-02 16:34:15 -0500
commita59365a582c3a8c9a8b863b572fddcb65fccadfd (patch)
treeed55c0e456b9146d84d74d4a529f7895a37f1872 /sh/start-stop-daemon.sh
parentdac5966ca40610797d2b2aabef17154ca3dc20af (diff)
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.
Diffstat (limited to 'sh/start-stop-daemon.sh')
-rw-r--r--sh/start-stop-daemon.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/sh/start-stop-daemon.sh b/sh/start-stop-daemon.sh
index 6a3e2050..ea992693 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}"