Hi List Mates,
Just a very early warning with regards to the latest released systemd version (version 210). In the release notes the following two items will have an effect on people that are utilizing laptops with a docking station and an external monitor.
* logind is now a lot more aggressive when suspending the machine due to a closed laptop lid. Instead of acting only on the lid close action it will continuously watch the lid status and act on it. This is useful for laptops where the power button is on the outside of the chassis so that it can be reached without opening the lid (such as the Lenovo Yoga). On those machines logind will now immediately re-suspend the machine if the power button has been accidentally pressed while the laptop was suspended and in a backpack or similar.
* logind will now watch SW_DOCK switches and inhibit reaction to the lid switch if it is pressed. This means that logind will not suspend the machine anymore if the lid is closed and the systemd is docked, if the laptop supports SW_DOCK notifications via the input layer. Note that ACPI docking stations do not generate this currently. Also note that this logic is usually not fully sufficient and Desktop Environments should take a lid switch inhibitor lock when an external display is connected, as systemd will not watch this on its own.
The first item concerns a change that systemd is monitoring if the lid is closed or not. This monitoring starts already during the system boot process which would lead to the effect that the system is forced into suspend mode even before the login manager is reached. To prevent this, the second item was implemented, however as indicated current kernels (including the latest 3.14- rc4) do not support this yet for all laptops. The issue however is that the system will not reach the Desktop Environment yet as that this new principle already kicks in during the boot process. So implementing a lid switch inhibitor in GNOME/KDE/etc does not make any sense as that the system will never reach the desktop environment.
I had a couple of email conversations with Lennart about this topic yesterday and finally with my last message he got the real issue that this happens during system boot and therefore systemd should handle this properly. He indicated that he will resolve the issue in one of the upcoming versions of systemd and also probably move the external monitor detection out of the DEs into logind. (The situation will then be that if the lid is closed and an external monitor is connected, then systemd will not suspend the system).
If the decision is taken by the systemd maintainers, then in my opinion it would be good to revert the two commits in systemd version 210 that implement the two items mentioned so that the old lid switch behavior is restored.