On Tuesday 25 February 2014 18:19:28 Takashi Iwai wrote:
What happens if a machine is booted with the lid closed (e.g. via WoL or a timer)? Will the machine go again to suspend immediately?
If the lid is closed and the machine is not docked (or docking is not detected), then yes the machine is directly suspended again. As indicated yesterday morning I had this issue while trying to boot the system. Before I realized what exactly was happening, the system suspended already around 4 times. Only opening the lid "resolved" it and the system booted normally. So yes, in the future if there is no external monitor connected then the system will directly go into suspend state again as that the lid is closed. As Lennart describes it as an accidental power-on of the system.
The integrating the external monitor detection into logind doesn't look like a good solution to me. The external monitor detection isn't guaranteed to work always, even if the lid switch detection works. For example, you can delay the loading of KMS module (e.g. nomodeset due to driver breakage). Then the external monitor can't be detected. Meanwhile, the lid switch is reported by the input driver, so logind will catch it and tries to suspend. I hope we won't fall into such a stupid scenario...
Lennart indicated that he would start working on a solution after release of version 210. This is the direction that he indicated and I guess that more knowledgeable persons than me in this area could try to talk to him in finding the right solution.