View previous topic :: View next topic |
Author |
Message |
bbell2610 n00b
Joined: 21 Aug 2006 Posts: 19
|
Posted: Thu Nov 30, 2006 5:08 am Post subject: how to modify startup script to add dependencies ??? |
|
|
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 |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Thu Nov 30, 2006 7:57 am Post subject: |
|
|
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 |
|
|
bbell2610 n00b
Joined: 21 Aug 2006 Posts: 19
|
Posted: Fri Dec 01, 2006 3:33 am Post subject: |
|
|
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 |
|
|
desultory Bodhisattva
Joined: 04 Nov 2005 Posts: 9410
|
Posted: Fri Dec 01, 2006 5:06 am Post subject: |
|
|
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 |
|
|
mark_alec Bodhisattva
Joined: 11 Sep 2004 Posts: 6066 Location: Melbourne, Australia
|
Posted: Fri Dec 01, 2006 6:08 am Post subject: |
|
|
Moved from Desktop Environments to Other Things Gentoo. _________________ www.gentoo.org.au || #gentoo-au |
|
Back to top |
|
|
|