From 51a9c647b9a1c209d57472fcd356368a00846a80 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Wed, 30 Jan 2008 13:37:20 +0000 Subject: Allow !net to remove the net provision from dependencies. --- etc/rc.conf | 5 +++++ man/runscript.8 | 3 ++- src/librc/librc-depend.c | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/etc/rc.conf b/etc/rc.conf index 8cfc0c9..041dd3b 100644 --- a/etc/rc.conf +++ b/etc/rc.conf @@ -85,9 +85,14 @@ net_fs_list="afs cifs coda davfs fuse gfs ncpfs nfs nfs4 ocfs2 shfs smbfs" #rc_use="net.eth0" #rc_after="clock" #rc_before="local" +#rc_provide="!net" # 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" + +# You can also remove dependencies. +# This is mainly used for saying which servies do NOT provide net. +#rc_net_tap0_provide="!net" diff --git a/man/runscript.8 b/man/runscript.8 index 07f8112..77c1592 100644 --- a/man/runscript.8 +++ b/man/runscript.8 @@ -114,7 +114,8 @@ will start and stop it in the right order in relation to other services. As it's a function it can be very flexable, see the example below. Here is a list of the functions you can use in a .Ic depend -function. You simply pass the names of the services to it. +function. You simply pass the names of the services to it to add to that +dpendency type, or prefix it with ! to remove it. .Bl -tag -width "RC_DEFAULTLEVEL" .It Ic need The service will refuse to start until needed services have started and it diff --git a/src/librc/librc-depend.c b/src/librc/librc-depend.c index c6ebf49..ad8e73d 100644 --- a/src/librc/librc-depend.c +++ b/src/librc/librc-depend.c @@ -832,6 +832,12 @@ bool rc_deptree_update (void) depend[len - 2] == 's' && depend[len - 1] == 'h') continue; + + /* Remove our dependency if instructed */ + if (depend[0] == '!') { + rc_strlist_delete (&deptype->services, depend + 1); + continue; + } rc_strlist_addsort (&deptype->services, depend); -- cgit v1.2.3