diff options
-rw-r--r-- | etc/rc.conf | 5 | ||||
-rw-r--r-- | man/runscript.8 | 3 | ||||
-rw-r--r-- | src/librc/librc-depend.c | 6 |
3 files changed, 13 insertions, 1 deletions
diff --git a/etc/rc.conf b/etc/rc.conf index 8cfc0c9f..041dd3ba 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 07f81123..77c15924 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 c6ebf495..ad8e73d1 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); |