Based on the guess that the removed sync dbus call in r2041 was causing a difference in timing, I added a sleep 5 to that same code line. That seems to fix the problem!
Adding a sleep 5 to the lightdm upstart job however, does not fix the problem. There are no relevant upstart jobs that are waiting for "started lightdm" (only mpt does). So I'm guessing it's a dbus activation race inside lightdm itself...
Based on the guess that the removed sync dbus call in r2041 was causing a difference in timing, I added a sleep 5 to that same code line. That seems to fix the problem!
Adding a sleep 5 to the lightdm upstart job however, does not fix the problem. There are no relevant upstart jobs that are waiting for "started lightdm" (only mpt does). So I'm guessing it's a dbus activation race inside lightdm itself...