X-Git-Url: http://git.grml.org/?p=grml-autoconfig.git;a=blobdiff_plain;f=autoconfig.functions;h=04f8088babfdab1f326ab8ae500f93fedb8a081b;hp=30f476c4c90f7ea1481e510ec595b887a72b73b0;hb=5a37523cc5cc18f932c3683e911fcad3c345baa4;hpb=48eb628cd8bc48ae4c234dd8905fe950f07b65c7 diff --git a/autoconfig.functions b/autoconfig.functions index 30f476c..04f8088 100755 --- a/autoconfig.functions +++ b/autoconfig.functions @@ -1439,11 +1439,18 @@ config_services(){ SERVICE="$(getbootparam 'services' 2>>$DEBUG)" SERVICELIST=$(echo "$SERVICE" | sed 's/,/\\n/g') SERVICENL=$(echo "$SERVICE" | sed 's/,/ /g') - einfo "Starting service(s) ${SERVICENL} in background." for service in $(echo -e $SERVICELIST) ; do - /etc/init.d/${service} start >>$DEBUG & + # support running (custom) init scripts in non-blocking mode + # if they contain the keyword "DO_NO_RUN_IN_BACKGROUND". + if grep -q 'DO_NO_RUN_IN_BACKGROUND' "/etc/init.d/${service}" 2>>$DEBUG ; then + einfo "Starting service ${service}." + /etc/init.d/${service} start >>$DEBUG + else + einfo "Starting service ${service} in background." + /etc/init.d/${service} start >>$DEBUG & + fi done - [ "$?" == "0" ] ; eend $? + eend $? fi } # }}}