Skip to content

sleep inhibitor prevents the system from shutting down #17

@AngelSherry

Description

@AngelSherry

Describe

Because there is a delay in sleep-inhibitor's detection status, when I try to shut down after completing a compilation using sleep-inhibitor, it prevents the shutdown and causes the entire desktop environment to go black.

I have no choice but to switch to a TTY and log in to manually force a reboot using sudo reboot -f, because a normal reboot results in a message stating that it was interrupted by sleep-inhibitor.

sleep-inhibitor should not forcibly take control of reboot or poweroff events.

My sleep-inhibitor.conf

# Configuration file for sleep-inhibitor program. Copy this to
# /etc/sleep-inhibitor.conf and edit as you want.
#
# Normally the plugin dir (for provided plugins) is automatically
# determined (e.g. at either /usr/share/sleep-inhibitor/plugins or
# /usr/local/share/sleep-inhibitor/plugins) but you can define it
# explicitly here if you want, e.g. for custom config file for testing.
#
# Note period values in this file are specified in minutes by default.
# E.g. "2" is 2 minutes. However, you can append an "s", "m", or "h" to
# specify in seconds, minutes, or hours, e.g. "2s" is 2 seconds, "2m" is
# 2 minutes (i.e. same as "2"), or "2h" is 2 hours.
#
plugin_dir: /etc/sleep-inhibitor/
#
# Default global check period in minutes. Can be specified for each
# plugin, or if not specified will be the global default you define
# here, or is 5 mins if not specified at all.
#
# period: 5
#
# Default global check period, while ON/INHIBITING, in minutes. Can be
# specified for each plugin, or if not specified will be the global
# default you define here, or is "period" above if not specified at all.
# Will be limited to "period" value so can not be larger.
#
# period_on:
#
# Default global "what" value. Can be specified for each plugin, or if
# not specified will the global default you define here. Takes a
# colon-separated list of one or more operations to inhibit. See the
# description of the --what option in the man page for systemd-inhibit.
# Defaults to the default value of that systemd-inhibit option.
#
# what:
#
# Plugins are defined following. You can define as many plugins as you
# require. Custom plugins are specified with an absolute path to your
# own executable file. Standard plugins (i.e. those included in the
# distribution plugins/ dir) are specified with no path.
#
# Arguments are specified as below:
# path:   Must be specified. Can be an absolute path for custom
#         plugins, or relative to the program distribution plugins/
#         directory for standard plugins.
# args:   Optional. Provides arguments to the above script if required.
# period: Optional. Specifies period to check in minutes. Defaults to
#         global value, see above.
# period_on: Optional. Specifies period to check (while ON/INHIBITING)
#         in minutes. Defaults to above "period" value, then global value.
# name:   Optional. Descriptive name for logging. Defaults to basename of
#         path.
# what:   Optional. Takes a colon-separated list of one or more
#         operations to inhibit. Defaults to global value, see above.

# Comment/delete out or edit the following examples, or add your own.
plugins:

    # Inhibit sleep if any audio is playing
    # - path: is-alsa-playing
    #   name: Audio Playing

    # Inhibit sleep when Plex media server is serving content to users.
    # You need to specify your Plex token as the argument here. To
    # determine your plex token, see
    # https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
    # To wake your PC if previously suspended, use any "wake on LAN" app
    # on your phone.
    # - path: plex-media-server
    #   name: Plex Media Server
    #   args: <your-plex-token>

    # Inhibit sleep when Jellyfin media server is serving content to users.
    # You need to specify your Plex token as the argument here. To
    # determine your plex token, see
    # https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
    # To wake your PC if previously suspended, use any "wake on LAN" app
    # on your phone.
    # - path: jellyfin-server
    #   name: Jellyfin Media Server
    #   args: <your-jellyfin-token>

    # Inhibit sleep if a process is running. Here I
    # suppress suspend if my home backup script is running.
    - path: is-process-running
      name: video2x
      args: video2x

    - path: is-process-running
      name: makepkg
      args: makepkg

    - path: is-process-running
      name: paru
      args: paru

    - path: is-process-running
      name: yay
      args: yay

    - path: is-process-running
      name: pikaur
      args: pikaur

    - path: is-process-running
      name: duperemove
      args: duperemove

    # Inhibit sleep if 1 or more remote users are logged in via ssh
    # suppress suspend if my home backup script is running.
    - path: ssh-session-open

    # Inhibit sleep if apk (Alpine [Linux] Package Keeper) is running
    # - path: apk-running

    # Inhibit sleep if pacman (Arch [Linux] Package Keeper) is running
    - path: pacman-running

# vim:se sw=2 syn=yaml et ai:

Information

Operating System: Arch Linux
KDE Plasma Version: 6.6.4
KDE Frameworks Version: 6.25.0
Qt Version: 6.11.0
Kernel Version: 6.18.22-1-cachyos-lts (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 9 5900HX with Radeon Graphics
Memory: 32 GiB of RAM (29.3 GiB usable)
Graphics Processor 1: AMD Radeon Graphics
Graphics Processor 2: NVIDIA GeForce RTX 3070 Laptop GPU
Manufacturer: ASUSTeK COMPUTER INC.
Product Name: ASUS TUF Gaming A15 FA506QR_FA506QR
System Version: 1.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions