summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <uberlord@gentoo.org>2006-07-20 17:16:38 +0000
committerRoy Marples <uberlord@gentoo.org>2006-07-20 17:16:38 +0000
commitded320f52f3872f2216dba5a832cd496ae20683a (patch)
treeb7e6421abcba51a4d64712323907b6739da412c8
parentFix quoting in valid_i and give better feedback about services not starting/s... (diff)
downloadbaselayout-ded320f52f3872f2216dba5a832cd496ae20683a.tar.gz
baselayout-ded320f52f3872f2216dba5a832cd496ae20683a.tar.bz2
baselayout-ded320f52f3872f2216dba5a832cd496ae20683a.zip
Enable RC_NEED="foo" and RC_USE="bar" in /etc/conf.d/${SERVICE}
so that users can overlay service dependencies with their own. Bug #140865 svn path=/branches/baselayout-1_12/; revision=2171
-rw-r--r--ChangeLog6
-rwxr-xr-xsbin/rc-help.sh14
-rw-r--r--src/awk/cachedepends.awk15
-rw-r--r--src/awk/gendepends.awk3
4 files changed, 33 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index dafbf948..8a19aade 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for Gentoo System Intialization ("rc") scripts
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPLv2
+ 20 Jul 2006; Roy Marples <uberlord@gentoo.org>:
+
+ Enable RC_NEED="foo" and RC_USE="bar" in /etc/conf.d/${SERVICE}
+ so that users can overlay service dependencies with their own.
+ Bug #140865
+
18 Jul 2006; Roy Marples <uberlord@gentoo.org>:
Report services scheduled to be started by another service as
diff --git a/sbin/rc-help.sh b/sbin/rc-help.sh
index 30a57368..769dd919 100755
--- a/sbin/rc-help.sh
+++ b/sbin/rc-help.sh
@@ -225,6 +225,20 @@ echo -e " /etc/conf.d/${SERVICE}${NL} /etc/rc.conf"
if [[ ${BE_VERBOSE} == "yes" ]] ; then
echo -e "
+ You can add extra dependencies to ${SERVICE} by adding some variables to
+ /etc/conf.d/${SERVICE}
+ RC_NEED=\"openvpn ntpd\"
+ RC_USE=\"dns\"
+
+ This makes ${SERVICE} need openvpn and ntpd, while it just uses dns.
+
+ A good example of this is nfsmount needing openvpn if the nfs mounts in
+ /etc/fstab are over the vpn link.
+"
+fi
+
+if [[ ${BE_VERBOSE} == "yes" ]] ; then
+echo -e "
${CYAN}Management:${OFF}
Services are added and removed via the 'rc-update' tool. Running it without
diff --git a/src/awk/cachedepends.awk b/src/awk/cachedepends.awk
index 46945e9e..06290697 100644
--- a/src/awk/cachedepends.awk
+++ b/src/awk/cachedepends.awk
@@ -1,6 +1,5 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header$
function print_start() {
print "source /sbin/functions.sh" >> TMPCACHE
@@ -48,7 +47,7 @@ function print_header2(mtime) {
print "" >> TMPCACHE
print " [ -e /etc/conf.d/net ] && \\" >> TMPCACHE
print " [ \"${SVCNAME%%.*}\" = \"net\" ] && \\" >> TMPCACHE
- print " [ \"${SVCNAME##*.}\" != \"${SVCNAME}\" ] && source /etc/conf.d/net" >> TMPCACHE
+ print " [ \"${SVCNAME#*.}\" != \"${SVCNAME}\" ] && source /etc/conf.d/net" >> TMPCACHE
print "" >> TMPCACHE
print " [ -e \"/etc/conf.d/${SVCNAME}\" ] && source \"/etc/conf.d/${SVCNAME}\"" >> TMPCACHE
print "" >> TMPCACHE
@@ -63,6 +62,16 @@ function print_header2(mtime) {
function print_end() {
print "" >> TMPCACHE
print " depend" >> TMPCACHE
+
+ # Support user defined RC_NEED and RC_USE
+ print "" >> TMPCACHE
+ print " for x in ${RC_NEED} ; do" >> TMPCACHE
+ print " need \"${x}\"" >> TMPCACHE
+ print " done" >> TMPCACHE
+ print "" >> TMPCACHE
+ print " for x in ${RC_USE} ; do" >> TMPCACHE
+ print " use \"${x}\"" >> TMPCACHE
+ print " done" >> TMPCACHE
print ")" >> TMPCACHE
print "" >> TMPCACHE
}
diff --git a/src/awk/gendepends.awk b/src/awk/gendepends.awk
index d092ccb2..82f1b549 100644
--- a/src/awk/gendepends.awk
+++ b/src/awk/gendepends.awk
@@ -1,6 +1,5 @@
-# Copyright 1999-2004 Gentoo Foundation
+# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header$
# bool check_service(name)
#