Right after install Fedora 17 with LXDE (and update to 18), I noticed this annoying behavior when closing the laptop lid: it just stop replying pings and went to sleep, even with the AC power plugged in.
Since I didn’t have the GNOME config tools available here (and didn’t want to install tons of libs and applications just to config this), I investigated a bit and found that logind was the culprit for that. After google a bit more, I’ve found this procedure that solves the issue:
All you have to do is edit the file /etc/systemd/logind.conf (as root) and uncomment/set the variable “HandleLidSwitch” to “ignore”, as in the example below:
[Login]
#NAutoVTs=6
#ReserveVT=6
#KillUserProcesses=no
#KillOnlyUsers=
#KillExcludeUsers=root
#Controllers=
#ResetControllers=cpu
#InhibitDelayMaxSec=5
#HandlePowerKey=poweroff
#HandleSuspendKey=suspend
#HandleHibernateKey=hibernate
HandleLidSwitch=ignore
#PowerKeyIgnoreInhibited=no
#SuspendKeyIgnoreInhibited=no
#HibernateKeyIgnoreInhibited=no
#LidSwitchIgnoreInhibited=yes
With this change, reboot your system (or just restart your display manager (thanks dmelo87)) and feel free to close your laptop lid that it will no longer go to sleep inadvertently.