From bbd40cf6a683a50f8c0a58406a6ff62dffa4842a Mon Sep 17 00:00:00 2001 From: Justin Garrison Date: Mon, 9 Oct 2023 20:28:15 -0700 Subject: [PATCH] systemd-inhibit: add page (#10879) * systemd-inhibit: add page --------- Co-authored-by: Juri Dispan Co-authored-by: K.B.Dharun Krishna Co-authored-by: Lena <126529524+acuteenvy@users.noreply.github.com> --- pages/linux/systemd-inhibit.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pages/linux/systemd-inhibit.md diff --git a/pages/linux/systemd-inhibit.md b/pages/linux/systemd-inhibit.md new file mode 100644 index 000000000..454b76e09 --- /dev/null +++ b/pages/linux/systemd-inhibit.md @@ -0,0 +1,29 @@ +# systemd-inhibit + +> Prohibit the system from entering certain power states. +> Inhibitor locks may be used to block or delay system sleep and shutdown requests as well as automatic idle handling. +> More information: . + +- List all active inhibition locks and the reasons for their creation: + +`systemd-inhibit --list` + +- Block system shutdown for a specified number of seconds with the `sleep` command: + +`systemd-inhibit --what shutdown sleep {{5}}` + +- Keep the system from sleeping or idling until the download is complete: + +`systemd-inhibit --what sleep:idle wget {{https://example.com/file}}` + +- Ignore lid close switch until the script exits: + +`systemd-inhibit --what sleep:handle-lid-switch {{path/to/script}}` + +- Ignore power button press while command is running: + +`systemd-inhibit --what handle-power-key {{command}}` + +- Describe who and why created the inhibitor (default: the command and its arguments for `--who` and `Unknown reason` for `--why`): + +`systemd-inhibit --who {{$USER}} --why {{reason}} --what {{operation}} {{command}}`