Maybe you want to keep your Linux system running when you close the lid of your laptop, but it hibernates. This might be annoying if you have an external monitor and do not want to use the laptop screen.
Assuming you are running systemd there is a way to change that behavior by configuration. Edit the file /etc/systemd/logind.conf and set the following properties:
HandleLidSwitch=ignore HandleLidSwitchExternalPower=ignore
Rebooting your OS should do no harm. :-) The system should keep running when you close the lid now.
See `man logind.conf` for further reading.