Page 1 of 1

Change a setting on Laptop servers. (IMPORTANT)

Posted: Fri Jan 05, 2018 3:38 pm
by Rob Swan
FOR LAPTOP SERVER USERS ONLY (NOT APPLICABLE FOR DESKTOP SERVERS)

Unfortunately when you close the lid of the laptop, your server will probably go into sleep mode which is completely useless to us as a webserver has to be running all the time.

We need to change a setting on your server to solve this problem and if your not very familiar with Linux servers it can be a bit tricky the first time you change a setting until you get used to it.

Unless you want to leave your laptop open for evermore (we don’t need to access it directly after this as we do this from windows remotely)

Log into your laptop server…..

At the prompt type: sudo vi /etc/systemd/logind.conf (press enter)

You may need to re-enter your password.

Image

Use the arrow keys to cursor down to the line #HandleLidSwitch=suspend

When your cursor is on the # of #HandleLidSwitch=suspend press i

At the bottom of the screen you should see -- INSERT --

Press the delete key to remove the # symbol (the line should change from blue to white).

Cursor across to the end of the line and then delete the word suspend and change it to ignore

The line should now read HandleLidSwitch=ignore

When you are sure the line is correct press Escape and the -- INSERT -- should disappear.

Image

Now press : (colon) (use the shift key to get the symbol on your keyboard).

At the bottom of the screen a colon should appear.

Press w (at the bottom of the screen it should say :w) and then press enter.

The w means we are telling the computer to write the file (save changes) and it should now indicate to you that this has happened at the bottom of the screen something like - "/etc/systemd/logind.conf" 35L, 984C written - will be displayed.

Now press : (colon) (use the shift key to get the symbol on your keyboard).

At the bottom of the screen a colon should appear.

Press q (at the bottom of the screen it should say :q) and then press enter.

This should exit the file editing application and return you to the prompt.

Finally reboot your server by typing sudo shutdown -r now (Press enter).

You may need to re-enter your password.

Image

Your server will now re-boot so just wait for the logon prompt again, but don’t log in!

Now close your laptop lid and it should stay running without going into sleep mode.

NOTE
Some laptops do not like to re-boot with the lid closed, however this can normally be fixed within the BIOS.
Please consult the manufacturers website or google if you are affected.

If all is ok leave the laptop closed from now on as we no longer need direct physical access to it.