[Nix-dev] Re: [Nix-commits] SVN commit: nix - 14839 - sandervanderburg - in nixos/trunk: system upstart-jobs
Eelco Dolstra
e.dolstra at tudelft.nl
Fri Apr 3 18:19:12 CEST 2009
Hi,
Ludovic Courtès wrote:
> Michael Raskin <7c6f434c at mail.ru> writes:
>
>> Arie Middelkoop wrote:
>>>> We have to use the directy sleep hack, because it there is time window between starting the dbus daemon process and when it is really active.
>>> You could create a busy loop with "dbus-send" and keep on retrying until
>>> it succeeds...
>> The only thing not to forget is to put "sleep 1" (or maybe "sleep 0.5")
>> inside. No better resource hog than misplaced spinlock.
>
> Can't we do any better? How does Ubuntu handle this?
Probably if you use "dbus-daemon --fork", it will fork after it's ready to
accept connections. So we should do "dbus-daemon --fork" in the Upstart job's
start script, then when the start script terminates and Upstart starts the
dependent jobs, we can be sure that dbus is ready.
The downside is that Upstart 0.3 can't monitor the job anymore. Upstart 0.5 has
the ability to monitor daemons that fork into the background (see
http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/).
--
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/
More information about the nix-dev
mailing list