Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved]init.d runscripts specifically depend/provide
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Bodger
n00b
n00b


Joined: 18 Nov 2004
Posts: 47

PostPosted: Fri Dec 28, 2007 1:00 am    Post subject: [solved]init.d runscripts specifically depend/provide Reply with quote

I hope this is the right forum to post this question in.

I want to write a init.d script and am trying to understand the part about depend.

Here is a snippet from the postfix init.d script.

Code:

depend() {
    use logger dns ypbind amavisd mysql postgresql antivirus postfix_greylist net saslauthd
    provide mta
}


I am looking at this and cannot seem to find any good docs on it. Here are my questions.

I want to create a service that other services depend on and looking at this code paragraph it looks like this is what is happening.

If "myservice" wants to start it could set:
Code:

depend () {
    use mta
    provide myservice
}


Then another service could depend on "myservice" and "myservice" depends on "mta".

This way "myservice" will start after Postfix.

Is this a proper way to interpret that code?
Will "myservice" be started after Postfix because of the dependency?

Both are to be installed with:

Code:

rc-update add postfix default
rc-update add myservice default


Thanx

Julian


Last edited by Bodger on Fri Dec 28, 2007 3:44 am; edited 1 time in total
Back to top
View user's profile Send private message
Suicidal
l33t
l33t


Joined: 30 Jul 2003
Posts: 959
Location: /dev/null

PostPosted: Fri Dec 28, 2007 2:03 am    Post subject: Reply with quote

not at my machine right now; but I think you are looking for:

need myservice

Gento initscripts
Back to top
View user's profile Send private message
Bodger
n00b
n00b


Joined: 18 Nov 2004
Posts: 47

PostPosted: Fri Dec 28, 2007 3:44 am    Post subject: Reply with quote

That article is exactly what I needed.

The operative word is indeed "need".

Thanx

Julian
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum