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.
This commit is contained in:
parent
dac5966ca4
commit
a59365a582
@ -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}"
|
||||
|
Loading…
Reference in New Issue
Block a user