From 0474f4399d115d0cc69e9f2215ab4ca472799450 Mon Sep 17 00:00:00 2001 From: Denys Havrysh Date: Thu, 28 Apr 2016 10:49:39 +0300 Subject: [PATCH] Debian: check if the service is going to be started at any runlevel, fixes bootstrap in container (Docker, LXC) --- bootstrap-salt.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index da3652c..dd73884 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -1889,8 +1889,8 @@ __check_services_debian() { servicename=$1 echodebug "Checking if service ${servicename} is enabled" - # shellcheck disable=SC2086,SC2046,SC2144 - if [ -f /etc/rc$(runlevel | awk '{ print $2 }').d/S*${servicename} ]; then + # Check if the service is going to be started at any runlevel, fixes bootstrap in container (Docker, LXC) + if ls /etc/rc?.d/S*"${servicename}" >/dev/null 2>&1; then echodebug "Service ${servicename} is enabled" return 0 else