Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a piece of software with different components running on the same Unix machine (web server, DBMS, middleware, different daemons). Startup of the few components depends on the success of the start of the previous ones (like DBMS). Some of the scripts can be run in the parallel. Is there an elegant approach to be able to control such script dependency and easily use parallelization mechanism as well to make startup of the components as fast as possible.

Similar solutions to the boot script are covered by upstart http://upstart.ubuntu.com/ so I am looking for something similar which would allow me to control own subsystems.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

if you have a way to tell if the service is ok not relying on the exit code, you can KISS it with a shell script using wait, e.g.

#!/bin/bash

start_parallel_service_1 &
start_parallel_service_2 &
start_parallel_service_3 &

wait # this will wait until all startup scripts exited

check_parallel_service_1 || exit
check_parallel_service_2 || exit
check_parallel_service_3 || exit

echo all ok
share|improve this answer

Debian implemented dependency based startup on Squeeze, you should take a look at it. The insserv manpage also has some information on LSB headers needed to make it work.

Basically, each script has to include a header that informs insserv on what each thing depends. That reorder the scripts but don't exactly makes the boot parallel, you can read more about how to make it so and other tips on starting the boot process on this doc.

Of course, all docs refer to Debian, but I am sure other distros can use something close.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.