diff options
author | Roy Marples <roy@marples.name> | 2008-01-02 15:42:52 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-01-02 15:42:52 +0000 |
commit | 28d7a19201d52e61112c90beee1511f09c036bd8 (patch) | |
tree | 5e2978cdae91b5c89c9ea4aa888e38e00271da2f | |
parent | fadee8e656807f466cdf39a9a9c0c113613bc36d (diff) |
Allow rc_$service_$deptype in rc.conf
-rw-r--r-- | etc/rc.conf | 5 | ||||
-rwxr-xr-x | sh/gendepends.sh | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/etc/rc.conf b/etc/rc.conf index 057d59df..659e5b11 100644 --- a/etc/rc.conf +++ b/etc/rc.conf @@ -82,3 +82,8 @@ net_fs_list="afs cifs coda davfs fuse gfs ncpfs nfs nfs4 ocfs2 shfs smbfs" #rc_after="clock" #rc_before="local" +# You can also enable the above commands here for each service. Below is an +# example for service foo. +#rc_foo_config="/etc/foo" +#rc_foo_need="openvpn" +#rc_foo_after="clock" diff --git a/sh/gendepends.sh b/sh/gendepends.sh index a2b2181a..662d3972 100755 --- a/sh/gendepends.sh +++ b/sh/gendepends.sh @@ -76,18 +76,18 @@ for _dir in /etc/init.d /usr/local/etc/init.d; do [ -e "${_dir}/../conf.d/${SVCNAME}" ] && . "${_dir}/../conf.d/${SVCNAME}" + [ -e /etc/rc.conf ] && . /etc/rc.conf + if . "${_dir}/${SVCNAME}"; then echo "${SVCNAME}" >&3 depend # Add any user defined depends - config ${rc_config} ${RC_CONFIG} - need ${rc_need} ${RC_NEED} - use ${rc_use} ${RC_USE} - before ${rc_before} ${RC_BEFORE} - after ${rc_after} ${RC_AFTER} - provide ${rc_provide} ${RC_PROVIDE} - keywords ${rc_keywords} ${RC_KEYWORDS} + for _deptype in config need use after before provide keywords; do + eval _depends=\$rc_$(shell_var "${SVCNAME}")_${_deptype} + [ -z "${_depends}" ] && eval _depends=\$rc_${_deptype} + ${_deptype} ${_depends} + done fi ) done |