From cd4bbdcd62be460dabc232f6bd52e3b2c347408a Mon Sep 17 00:00:00 2001 From: Kerin Millar Date: Wed, 13 Oct 2021 05:57:59 +0100 Subject: 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 --- init.d/s6-svscan.in | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/init.d/s6-svscan.in b/init.d/s6-svscan.in index 18ed0ad0..917e5c83 100644 --- a/init.d/s6-svscan.in +++ b/init.d/s6-svscan.in @@ -21,9 +21,13 @@ depend() start_pre() { - einfo "Creating s6 scan directory" - checkpath -d -m 0755 "$RC_SVCDIR"/s6-scan - return $? + 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 + fi + return } stop_post() -- cgit v1.2.3