From b32c9c1139340980692bb7a1a7a79bb7f93e61d7 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Fri, 1 May 2009 09:37:51 +0100 Subject: Ensure that rc.d services are not started twice if PKG_DIR is blank. Fixes #170 --- init.d/rc-enabled.in | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'init.d/rc-enabled.in') diff --git a/init.d/rc-enabled.in b/init.d/rc-enabled.in index f01870a..fe84216 100644 --- a/init.d/rc-enabled.in +++ b/init.d/rc-enabled.in @@ -13,8 +13,9 @@ depend() start() { ebegin "Starting local rc services" - local svc= enabled= retval=0 service= - for svc in $(rcorder /etc/rc.d/* @PKG_PREFIX@/etc/rc.d/* 2>/dev/null); do + local svc= enabled= retval=0 service= pkgdir= + [ -n "@PKG_PREFIX@" ] && pkgdir="@PKG_PREFIX@/etc/rc.d/*" + for svc in $(rcorder /etc/rc.d/* $pkgdir 2>/dev/null); do [ -x "$svc" ] || continue service=${svc##*/} @@ -26,7 +27,7 @@ start() # If we have an init script for this service, continue rc-service --exists "$service" && continue - # Ensure that the users rc.conf will start us - ignore the defaults + # Ensure that the users rc.conf will start us eval enabled=\$${svc##*/}_enable yesno $enabled || yesno ${svc##*/} || continue -- cgit v1.2.3