implementing serialized startup sequence
Enrico Scholz
enrico.scholz at sigma-chemnitz.de
Mon Mar 15 16:07:38 GMT 2010
Scott James Remnant <scott-Umf49k1wg4FWk0Htik3J/w at public.gmane.org>
writes:
> You could have a job that started things in order:
>
> start on startup
> script
> start job1
> start job2
> start job3
> end script
>
> If job1, job2 & job3 have "task" in them - this will run each one in
> turn and wait for each one to finish before running the next.
>
>> Stanza support for this would be *extremely* good thing; it would be
>> great if we could define the critical sections (say in upstart.conf) one
>> way or the other. Scott, any plans for this? We're happy to cook up
>> a experimental patch if you consider this worthwhile. We surely do.
>>
> How would this differ from the example above?
It would differ when 'job2' is optional and not installed on every
system. Real world example are 'hald' and 'acpid' daemons. Both can
can be installed and used without the other one, but when they are
installed both, 'acpid' must be started before 'hald'.
I want to avoid modifying the acpid + hald scripts
| --- acpid.conf ---
| start on mounted-local
| exec acpid -f
|
| --- hald.conf ---
| start on mounted-local
| exec hald
and solved it by an helper task
| --- wait/acpid-hald.conf ---
| start on (starting hald and started acpid)
| task
| exec true
which is installed when both daemons are active.
Nevertheless, the handling of 'wait/acpid-hald.conf' is not nice because
this file must be installed and removed manually. Something like a
'requires' stanza would make this easier; e.g.
| --- wait/acpid-hald.conf ---
| ...
| requires acpid and hald
(--> ignore this job when not both 'acpid' and 'hald' are existing)
Enrico
More information about the upstart-devel
mailing list