From a59365a582c3a8c9a8b863b572fddcb65fccadfd Mon Sep 17 00:00:00 2001 From: William Hubbs Date: Fri, 2 Oct 2015 16:34:15 -0500 Subject: [PATCH] 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 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}"