commit 3a7bf8d378837e6d41e1afc0cbbdef04a06a6ba5 parent ef42a4d9b3a8e3e93d631171732d1c31eff4b0c0 Author: pyratebeard <root@pyratebeard.net> Date: Mon, 4 Nov 2024 14:55:59 +0000 cut_the_power Diffstat:
M | entry/cut_the_power.md | | | 58 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- |
1 file changed, 57 insertions(+), 1 deletion(-)
diff --git a/entry/cut_the_power.md b/entry/cut_the_power.md @@ -8,8 +8,64 @@ It is possible to disable to power off function of a power button (this was test Edit the file _/etc/systemd/logind.conf_ ``` +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it under the +# terms of the GNU Lesser General Public License as published by the Free +# Software Foundation; either version 2.1 of the License, or (at your option) +# any later version. +# +# Entries in this file show the compile time defaults. Local configuration +# should be created by either modifying this file (or a copy of it placed in +# /etc/ if the original file is shipped in /usr/), or by creating "drop-ins" in +# the /etc/systemd/logind.conf.d/ directory. The latter is generally +# recommended. Defaults can be restored by simply deleting the main +# configuration file and all drop-ins located in /etc/. +# +# Use 'systemd-analyze cat-config systemd/logind.conf' to display the full config. +# +# See logind.conf(5) for details. + +[Login] +#NAutoVTs=6 +#ReserveVT=6 +#KillUserProcesses=no +#KillOnlyUsers= +#KillExcludeUsers=root +#InhibitDelayMaxSec=5 +#UserStopDelaySec=10 +#SleepOperation=suspend-then-hibernate suspend +#HandlePowerKey=off +#HandlePowerKeyLongPress=ignore +#HandleRebootKey=reboot +#HandleRebootKeyLongPress=poweroff +#HandleSuspendKey=suspend +#HandleSuspendKeyLongPress=hibernate +#HandleHibernateKey=hibernate +#HandleHibernateKeyLongPress=ignore +#HandleLidSwitch=suspend +#HandleLidSwitchExternalPower=suspend +#HandleLidSwitchDocked=ignore +#PowerKeyIgnoreInhibited=no +#SuspendKeyIgnoreInhibited=no +#HibernateKeyIgnoreInhibited=no +#LidSwitchIgnoreInhibited=yes +#RebootKeyIgnoreInhibited=no +#HoldoffTimeoutSec=30s +#IdleAction=ignore +#IdleActionSec=30min +#RuntimeDirectorySize=10% +#RuntimeDirectoryInodesMax= +#RemoveIPC=yes +#InhibitorsMax=8192 +#SessionsMax=8192 +#StopIdleSessionSec=infinity ``` Uncomment and modify the value of `#HandlePowerKey=off` to `ignore`, then reboot. -1: https://askubuntu.com/a/362931 +This solution was posted by jeremija on [AskUbuntu][askubuntu]. + +Now my little ones can push the power button to their hearts content without shutting down my system. + +[askubuntu]: https://askubuntu.com/a/362931