Managing FastAPI Projects with Poetry: A Step-by-Step Guide

If you're using a laptop with Ubuntu 22.04 and you want to keep it running even when the lid is closed, you'll need to modify a system configuration file.
This is particularly useful if you're running long processes or using the laptop as a server. Here's a step-by-step guide on how to do it.
You'll need to edit the /etc/systemd/logind.conf file with superuser privileges.
This file controls how the system responds to various events, including the lid being closed. Here's how to modify it:
In the logind.conf file, find the line that says #HandleLidSwitch=suspend.
Change it to HandleLidSwitch=ignore. This tells the system to ignore the lid being closed and keep running.
After saving the file, you need to apply the changes. You can either reboot your laptop or restart the systemd-logind.service. To restart the service, use the following command in the terminal:
With these changes, your Ubuntu 22.04 laptop will continue to run even when the lid is closed. This is extremely useful for various scenarios, including server use, downloading files, or running processes that take a long time.
Comments
Post a Comment