Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to modify startup script to add dependencies ???
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
bbell2610
n00b
n00b


Joined: 21 Aug 2006
Posts: 19

PostPosted: Thu Nov 30, 2006 5:08 am    Post subject: how to modify startup script to add dependencies ??? Reply with quote

How do I modify the startup script for a program in /etc/init.d such that it waits for dependent programs to start before attempting to start? Is there a timeout value? Will it autostart the dependent services?
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Thu Nov 30, 2006 7:57 am    Post subject: Reply with quote

By way of example, from /etc/init.d/apache2
Code:
depend() {
        need net
        use mysql dns logger netmount postgresql
        after sshd
}

The above snippet indicates: the service should not be started when net is not considered to be up; the service depends upon the optional mysql, dns, logger, netmount and postgresql services; and that the service should be started after the sshd service (if present) although no actual dependancy is present.

There is no timeout.

Dependancies will be started if they are otherwise present in the present runlevel.
Back to top
View user's profile Send private message
bbell2610
n00b
n00b


Joined: 21 Aug 2006
Posts: 19

PostPosted: Fri Dec 01, 2006 3:33 am    Post subject: Reply with quote

So, if I am wanting to make sure that dansguardian starts after, but also depends upon squid and apache2 then should I use the keyword "need", "use" or "after"?
Back to top
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Fri Dec 01, 2006 5:06 am    Post subject: Reply with quote

The 'need' flag indicates service dependence, the 'use' flag indicates logical dependence, the 'after' flag indicates ordering for user convenience. So, 'use'.
Back to top
View user's profile Send private message
mark_alec
Bodhisattva
Bodhisattva


Joined: 11 Sep 2004
Posts: 6066
Location: Melbourne, Australia

PostPosted: Fri Dec 01, 2006 6:08 am    Post subject: Reply with quote

Moved from Desktop Environments to Other Things Gentoo.
_________________
www.gentoo.org.au || #gentoo-au
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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