Turning off Lid Close Standby on Ubuntu Server 14.04 LTS in Three Easy Steps
Let's say you've turned your old laptop into a server. Great choice! It's smaller than a full size tower, uses less power, is quieter (most of the time) and if you can't access it you can tab right in on the physical keyboard and screen.
However, open laptops take up more space, so you'll want to close the lid, right? On Ubuntu Server, closing the lid will put your server in standby, which is... unhelpful, to say the least.
Well, here's how to stop that from happening, for all version of Ubuntu from 13.10 onwards (13.10, 14.04 LTS, 14.10 as of January 2015)
/etc/systemd/logind.conf with a text editor
sudo vim /etc/systemd/logind.conf
Find the line with
HandleLidSwitch and change it to
Save, exit and restart the daemon
sudo service systemd-logind restart
Et Voila! Your server is now happy about running with its lid closed!