aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-05-01 09:37:51 +0100
committerRoy Marples <roy@marples.name>2009-05-01 09:37:51 +0100
commitb32c9c1139340980692bb7a1a7a79bb7f93e61d7 (patch)
tree5e82326486726c63f790cc2bfc328738300824fc
parentfb051bf81ac698d0618b611abc7120c32da467c3 (diff)
Ensure that rc.d services are not started twice if PKG_DIR is blank.
Fixes #170
-rw-r--r--init.d/rc-enabled.in7
1 files changed, 4 insertions, 3 deletions
diff --git a/init.d/rc-enabled.in b/init.d/rc-enabled.in
index f01870a9..fe842160 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