Computer Goes To Sleep Whenever I Close It After Changing 'logind.conf'

I recently fully reinstalled Fedora41 on my laptop server (using it to host minecraft! that worked!). As with whenever I set this up Linux on this laptop, I go into /etc/systemd.conf/ and edit logind.conf. Oddly I didn’t see a logind.conf file, so I looked it up and found this thread: ubuntu thread

I looked through that thread and checked out the source, finding the logind.conf file in
/usr/lib/systemd/logind.conf. I go into this file and edit the lines to

HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore

I write out and figure it’ll work once I reboot. Once I reboot I login to cockpit and then close the lid. Oddly it stops responding. Once I reopen the laptop, cockpit wouldn’t restart. Eventually I try rebooting the computer and cockpit works. I try again to see if maybe it was a fluke but it gave the same results.
I also tried copying logind.conf from /usr/lib/systemd/ to /ect/systemd/ and rebooting, but that had the same result. I believe I did a couple other things, but they aren’t coming to mind right now, sorry!
I came up with one of those things, I also changed sleep.conf and it didn’t do anything.
If there’s any logs I can dump, tell me how to get them and I’ll send them over. I normally don’t post on these websites because I can normally find information but I am lost. I looked around and I couldn’t find anything about this, so I made an account on here and thought I’d ask you guys. Thanks in advance!

It fixed itself? I’m very confused, but yay! Apologies to anyone who comes across this thread, try waiting it out and messing with those files :stuck_out_tongue:
thanks!

I did this on a laptop with Fedora Server:

sudo mkdir -p '/etc/systemd/logind.conf.d' && echo -e "[Login]\nHandleLidSwitch=ignore" | sudo tee '/etc/systemd/logind.conf.d/99-laptop-server.conf' > '/dev/null'

On Workstation/GNOME I think having an external display connected might cause it to automatically not suspend on lid close; I haven’t had to configure anything and usually use my laptop docked (lid shut doesn’t suspend).

Some laptops might have a BIOS option to enable/disable lid switch state (Dell usually does).