I recently installed CoreOS on an old laptop and I’ve been running into an issue. When I close my laptop, logind helpfully suspends the system. I’d love it if I could have that enabled when the laptop isn’t plugged into power, but disable it when the laptop is plugged in. I’d be happy to compromise on totally disabling suspend.
Starting off with the simple case of just trying to disable the lid switch triggering a suspend entirely, I believe if I could get this into the systemd-logind.service’s config, it would properly keep it from suspending when I shut my laptop.
[Login]
HandleLidSwitch=ignore
I’m new to CoreOS, but as far as I can tell the correct way to do this is with a dropin configuration file? This is the Ignition file I wrote and installed with sudo coreos-installer install /dev/sda --insecure-ignition --ignition-url=http://foo/bar.ign
"ignition": {
"version": "3.3.0"
},
"passwd": {
"users": [
{
"name": "core",
"sshAuthorizedKeys": [
"ssh-rsa ...."
]
}
]
},
"systemd": {
"units": [
{
"name": "systemd-logind.service",
"dropins": [
{
"name": "inhibit-suspend.conf",
"Contents": "[Login]\nHandleLidSwitch=ignore\n"
}
]
}
]
}
}
It does create /etc/systemd/system/systemd-logind.service.d/inhibit-suspend.conf
which has those contents properly. I can’t tell if the configuration is getting picked up and not doing what I expected it to, or if the configuration isn’t getting picked up at all.
What am I missing? Have any of you installed CoreOS on a laptop and managed to keep it from suspending when you close the laptop?
Edit: this would solve it, but I’d like to do it in something that can be baked into my setup instead of having to go edit logind.conf by hand Notebook Suspend - User vs System level settings