init.d/s6-svscan.in: make sure $command exists

While the s6-svscan runscript belongs to OpenRC, the user is required to
install s6 before it can actually be used, potentially leading to
confusion. Check for the existence of $command in start_pre and, if it does not
exist, bail out with an error that makes this observation.

X-Gentoo-Bug: 816978
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=816978
This commit is contained in:
Kerin Millar 2021-10-13 05:57:59 +01:00 committed by William Hubbs
parent 2b55ac719a
commit cd4bbdcd62

View File

@ -21,9 +21,13 @@ depend()
start_pre()
{
if [ ! -e "$command" ]; then
eerror "$command is missing (please install s6)"
else
einfo "Creating s6 scan directory"
checkpath -d -m 0755 "$RC_SVCDIR"/s6-scan
return $?
fi
return
}
stop_post()