0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Fedora Workstation 43で自動サスペンドを無効にする (CUI)

0
Posted at

TL;DR

$ sudo vi /usr/lib/systemd/sleep.conf
[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no

対処法(詳細)

suspend・hybernate機能自体を無効にしてしまう。

まずman systemd-sleep.confで、設定ファイルの場所を確認する。

$ man systemd-sleep.conf

SYSTEMD-SLEEP.CONF(5)                              systemd-sleep.conf                             SYSTEMD-SLEEP.CONF(5)

NAME
       systemd-sleep.conf, sleep.conf.d - Suspend and hibernation configuration file

SYNOPSIS
           /etc/systemd/sleep.conf
           /run/systemd/sleep.conf
           /usr/lib/systemd/sleep.conf
           /etc/systemd/sleep.conf.d/*.conf
           /run/systemd/sleep.conf.d/*.conf
           /usr/lib/systemd/sleep.conf.d/*.conf

これらをlsで探していく。Fedora43では、/usr/lib/systemd/sleep.confのみがデフォルトで存在するようだ。これを直接編集する。

$ ls /etc/systemd/sleep.conf
ls: '/etc/systemd/sleep.conf' にアクセスできません: そのようなファイルやディレクトリはありません
$ ls /run/systemd/sleep.conf
ls: '/run/systemd/sleep.conf' にアクセスできません: そのようなファイルやディレクトリはありません
$ ls /usr/lib/systemd/sleep.conf
/usr/lib/systemd/sleep.conf
$ ls /usr/lib/systemd/sleep.conf.d/*.conf
ls: '/usr/lib/systemd/sleep.conf.d/*.conf' にアクセスできません: そのようなファイルやディレクトリはありません
$ sudo vi /usr/lib/systemd/sleep.conf

以下4行のコメントアウトを外し、noにする。

[Sleep]
AllowSuspend=no
AllowHibernation=no
AllowSuspendThenHibernate=no
AllowHybridSleep=no

書き込んだら再起動する。

背景

Fedoraの自動サスペンドは、以下の設定でOFFにできるとされている。

$ sudo -u gdm dbus-run-session gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
$ sudo -u gdm dbus-run-session gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 0
$ sudo -u gdm dbus-run-session gsettings list-recursively org.gnome.settings-daemon.plugins.power | grep sleep
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 0
org.gnome.settings-daemon.plugins.power sleep-inactive-ac-type 'nothing'
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 900
org.gnome.settings-daemon.plugins.power sleep-inactive-battery-type 'suspend'

Fedora Workstationを個人用Gitサーバに転用しているが、Fedora 43へのアップデート以降自動サスペンドがOFFにできない。どうにも、モニターを接続せずに使用すると、自動でサスペンドしてしまうことがあるようだ。

Gnomeプラグインcaffeineをインストールし、これをCUIからアクティブにすることも試みたが、駄目だった。
https://extensions.gnome.org/extension/517/caffeine/

$ sudo dnf install gnome-shell-extension-caffeine
$ gsettings --schemadir /usr/share/gnome-shell/extensions/caffeine@patapon.info/schemas/ set org.gnome.shell.extensions.caffeine user-enabled true
$ gsettings --schemadir /usr/share/gnome-shell/extensions/caffeine@patapon.info/schemas/ get org.gnome.shell.extensions.caffeine user-enabled
true
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?