0

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.

2 Answers2

1

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.

coredump
  • 12,573
  • 2
  • 34
  • 53
0

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
Aleksandar Ivanisevic
  • 3,327
  • 19
  • 24