やりたかったこと
ArchlinuxをThinkpadHelix2(Versapro)にインストールしたが、Windowsと同じくスリープやハイバーネートなどの動作が宜しくない。pm-utils
とsystemd
との相性が良くないようなので*1 Uswsusp
を使えるようにした。
やったこと
AURから
uswsusp-git
をインストールする。現在(2017/03/12)ではcompress
オプションを設定してしまうと、起動プロセスが途中で停止してしまうのでとりあえずこのオプションは外しておくのがオススメ。一通り適切な設定を行い
# s2disk
コマンドの動作を確認する。systemd
にデフォルトで用意されているsuspend
の設定を編集する。まずはデフォルトの設定ファイルをコピーする。
sudo cp /usr/lib/systemd/system/systemd-suspend.service /etc/systemd/system
次に、デフォルトのサスペンドの代わりにUswsusp
のs2disk
を使用するようにする
/etc/systemd/system/systemd-suspend.service
# 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.
[Unit]
Description=Suspend
Documentation=man:systemd-suspend.service(8)
DefaultDependencies=no
Requires=sleep.target
After=sleep.target
[Service]
Type=oneshot
# ExecStart=/usr/lib/systemd/systemd-sleep suspend
ExecStartPre=-/usr/bin/run-parts -v -a pre /usr/lib/systemd/system-sleep
ExecStart=/usr/bin/s2disk
ExecStartPost=-/usr/bin/run-parts -v --reverse -a post /usr/lib/systemd/system-sleep
- 私はGnomeユーザーなのでtweakツールで蓋を閉じたときの動作を「なし」に設定し、設定パネルから電源ボタンを押したときの動作を「サスペンド」に設定した。
参考文献
*1 https://wiki.archlinuxjp.org/index.php/Pm-utils
https://wiki.archlinuxjp.org/index.php/Uswsusp
http://qiita.com/a_yasui/items/f2d8b57aa616e523ede4