The latest git master of Systemd has changed the approach in the logind module to prevent suspended systems from switching on accidentally. The validation is that it checks if the lid is still closed or not. Of course this would always be true for docked laptops and therefore they also validate if the event SW_DOCK has been set. Checking this on my laptop, indicated that the SW_DOCK is never set and therefore during the boot process with the latest systemd, the system will constantly go to sleep when docked as that the lid is closed. After talking with Lennart Poettering, he check the code and also talked to Matthew Garrett about this issue and it seems that the ACPI docking code doesn't have SW_DOCK implemented. I am not sure for how many laptop vendors this is correct (I am running a Thinkpad (IBM/Lenovo)), but this would become a big issue once systemd 210 is being released.
I think this bug mostly needs to be filed in systemd. Lots of machines don't reliably report LID state let alone dock.
Having dug further this is clearly a Systemd problem. 1. SW_DOCK isn't required 2. It only covers system docs not 3rd party docks (eg USB, PCI split bridge, Thunderbolt etc) 3. Lots of passive docks are not covered by it 4. It's perfectly possible to have a laptop shut and driving an external display without a dock. 5. There are legitimate timed wakeup cases with lid closed (eg waking up to collect email) 5. "Docked" for some devices like convertibles simply means "keyboard unit attached" As far as I can tell systemd needs fixing to do something like not suspend when any of the following is true - any external output is active - an external keyboard is connected - mains power is on - under 3 minutes have elapsed since the wakeup closing this bug therefore, it's not a kernel problem but a problem with the systemd heuristic.
I concur w/ Alan, except this isn't closed as "Will not fix", it is closed as "invalid".