Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sleep: Add debug feature to bypass hibernation memory checks (useful in SSD setups with no regular swap). #3064

Merged
merged 1 commit into from Apr 19, 2016

Conversation

VittGam
Copy link
Contributor

@VittGam VittGam commented Apr 18, 2016

This patch adds a new debug feature that bypasses checking if a swap partition is mounted or if there is enough swap space available for hibernation to succeed.

This can be useful when a system with a Solid State Disk (SSD) has no normal swap partition or file configured, and a custom systemd unit is used to mount a swap file just before hibernating and unmount it just after resuming.

This is a follow-up to #3006.

I'm personally using this feature along with this unit:

[Unit]
Description=Mount and unmount swap file when hibernating or resuming
DefaultDependencies=no
Before=systemd-hibernate.service systemd-hybrid-sleep.service
StopWhenUnneeded=yes
RefuseManualStart=yes
RefuseManualStop=yes

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/bin/swapon /hiberfil.bin
ExecStop=/usr/bin/swapoff /hiberfil.bin
TimeoutStopSec=infinity

[Install]
RequiredBy=systemd-hibernate.service systemd-hybrid-sleep.service

This new feature bypasses checking if a swap partition is mounted
or if there is enough swap space available for hibernation to
succeed.

This can be useful when a system with a Solid State Disk (SSD)
has no normal swap partition or file configured, and a custom
systemd unit is used to mount a swap file just before hibernating
and unmount it just after resuming.

Signed-off-by: Vittorio Gambaletta <git-systemd@vittgam.net>
@poettering
Copy link
Member

We don't do S-o-b in systemd btw, see CODING_STYLE.

@poettering poettering merged commit 490d20e into systemd:master Apr 19, 2016
@VittGam
Copy link
Contributor Author

VittGam commented Apr 19, 2016

Ok, sorry about that.

@VittGam VittGam deleted the patch-1 branch April 19, 2016 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

2 participants