The following 3 patches changes the way services are started up and identify themselves to the monitor.
The first patch is just minor or cosmetic fixes.
The second patch changes the identification from monitor initiated to service initiated and acked by the monitor. This allows the service to perform the identification after it has completely set up all the dbus channel and is ready to receive a reply avoiding nasty race conditions.
The third patch changes the way services are started at startup. The Data Provider service is given a 1 second advantage so that it should normally be all set up by the time other service start and try to connect to it. This way services normally avoid racing against dp and can fully initialize on the first attempt and not rely on reconnection.
Initial testing seem to work pretty well and startup does not show ugly errors anymore.
I may send an additional separate patch to make services identify against dp the same way they do against the monitor (ie service initiated instead of server initiated). A patch will follow if I can pull it off in a short time frame.
Simo.