summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.d/rc-enabled.in4
-rw-r--r--sh/gendepends.sh.in10
-rw-r--r--sh/runscript.sh.in4
-rw-r--r--src/includes/rc-misc.h22
4 files changed, 19 insertions, 21 deletions
diff --git a/init.d/rc-enabled.in b/init.d/rc-enabled.in
index 9801203..f222e6a 100644
--- a/init.d/rc-enabled.in
+++ b/init.d/rc-enabled.in
@@ -24,9 +24,7 @@ start()
done
# If we have an init script for this service, continue
- [ -x @SYSCONFDIR@/init.d/"${service}" ] && continue
- [ -x @PKG_PREFIX@/@SYSCONFDIR@/init.d/"${service}" ] && continue
- [ -x @LOCAL_PREFIX@/@SYSCONFDIR@/init.d/"${service}" ] && continue
+ rc-service --list | grep -q "${service}" && continue
# Ensure that the users rc.conf will start us - ignore the defaults
eval enabled=\$${svc##*/}_enable
diff --git a/sh/gendepends.sh.in b/sh/gendepends.sh.in
index 8ab50ad..806c79b 100644
--- a/sh/gendepends.sh.in
+++ b/sh/gendepends.sh.in
@@ -4,7 +4,7 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
-. @PREFIX@/@SYSCONFDIR@/init.d/functions.sh
+. @SYSCONFDIR@/init.d/functions.sh
config() {
[ -n "$*" ] && echo "${RC_SVCNAME} config $*" >&3
@@ -33,9 +33,9 @@ depend() {
_done_dirs=
for _dir in \
-@PREFIX@/@SYSCONFDIR@/init.d \
-@PKG_PREFIX@/@SYSCONFDIR@/init.d \
-@LOCAL_PREFIX@/@SYSCONFDIR@/init.d
+@SYSCONFDIR@/init.d \
+@PKG_PREFIX@/etc/init.d \
+@LOCAL_PREFIX@/etc/init.d
do
[ -d "${_dir}" ] || continue
@@ -76,7 +76,7 @@ do
. "${_dir}/../conf.d/${RC_SVCNAME}"
fi
- [ -e @PREFIX@/@SYSCONFDIR@/rc.conf ] && . @PREFIX@/@SYSCONFDIR@/rc.conf
+ [ -e @SYSCONFDIR@/rc.conf ] && . @SYSCONFDIR@/rc.conf
if . "${_dir}/${RC_SVCNAME}"; then
echo "${RC_SVCNAME}" >&3
diff --git a/sh/runscript.sh.in b/sh/runscript.sh.in
index 51777fa..4492888 100644
--- a/sh/runscript.sh.in
+++ b/sh/runscript.sh.in
@@ -4,7 +4,7 @@
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.
-. @PREFIX@/@SYSCONFDIR@/init.d/functions.sh
+. @SYSCONFDIR@/init.d/functions.sh
. "${RC_LIBDIR}"/sh/rc-functions.sh
# Support LiveCD foo
@@ -67,7 +67,7 @@ fi
unset _conf_d
# Load any system overrides
-[ -e @PREFIX@/@SYSCONFDIR@/rc.conf ] && . @PREFIX@/@SYSCONFDIR@/rc.conf
+[ -e @SYSCONFDIR@/rc.conf ] && . @SYSCONFDIR@/rc.conf
# Apply any ulimit defined
[ -n "${rc_ulimit:-${RC_ULIMIT}}" ] && ulimit ${rc_ulimit:-${RC_ULIMIT}}
diff --git a/src/includes/rc-misc.h b/src/includes/rc-misc.h
index 81ffbc6..846e8dc 100644
--- a/src/includes/rc-misc.h
+++ b/src/includes/rc-misc.h
@@ -41,39 +41,39 @@
# define LIB "lib"
#endif
-#ifndef SYSCONFDIR
-# define SYSCONFDIR "/etc"
-#endif
-
#ifdef PREFIX
# define RC_PREFIX PREFIX
#else
# define RC_PREFIX
#endif
+#ifndef SYSCONFDIR
+# define SYSCONFDIR RC_PREFIX "/etc"
+#endif
+
#define RC_LEVEL_BOOT "boot"
#define RC_LEVEL_DEFAULT "default"
#define RC_LIBDIR RC_PREFIX "/" LIB "/rc"
#define RC_SVCDIR RC_LIBDIR "/init.d"
#define RC_DEPTREE_CACHE RC_SVCDIR "/deptree"
-#define RC_RUNLEVELDIR RC_PREFIX SYSCONFDIR "/runlevels"
-#define RC_INITDIR RC_PREFIX SYSCONFDIR "/init.d"
-#define RC_CONFDIR RC_PREFIX SYSCONFDIR "/conf.d"
+#define RC_RUNLEVELDIR SYSCONFDIR "/runlevels"
+#define RC_INITDIR SYSCONFDIR "/init.d"
+#define RC_CONFDIR SYSCONFDIR "/conf.d"
/* PKG_PREFIX is where packages are installed if different from the base OS
* On Gentoo this is normally unset, on FreeBSD /usr/local and on NetBSD
* /usr/pkg. */
#ifdef PKG_PREFIX
-# define RC_PKG_INITDIR PKG_PREFIX SYSCONFDIR "/init.d"
-# define RC_PKG_CONFDIR PKG_PREFIX SYSCONFDIR "/conf.d"
+# define RC_PKG_INITDIR PKG_PREFIX "/etc/init.d"
+# define RC_PKG_CONFDIR PKG_PREFIX "/etc/conf.d"
#endif
/* LOCAL_PREFIX is for user written stuff, which the base OS and package
* manger don't touch. */
#ifdef LOCAL_PREFIX
-# define RC_LOCAL_INITDIR LOCAL_PREFIX SYSCONFDIR "/init.d"
-# define RC_LOCAL_CONFDIR LOCAL_PREFIX SYSCONFDIR "/conf.d"
+# define RC_LOCAL_INITDIR LOCAL_PREFIX "/etc/init.d"
+# define RC_LOCAL_CONFDIR LOCAL_PREFIX "/etc/conf.d"
#endif
#define RC_KRUNLEVEL RC_SVCDIR "/krunlevel"