#484212 Disable hibernation if swap is on file

#484212#5
Date:
2008-06-03 00:17:02 UTC
From:
To:
If any swap device is on file, hibernation should be disabled. There
were reports of users ending up with a frozen system. It should be a
matter of going through the swapon -s list. Possible patch:

diff -u pm-utils-1.1.2.2/debian/changelog pm-utils-1.1.2.2/debian/changelog
--- pm-utils-1.1.2.2/debian/changelog
+++ pm-utils-1.1.2.2/debian/changelog
@@ -1,3 +1,9 @@
+pm-utils (1.1.2.2-2) hardy; urgency=low
+
+  * Disable hibernation if swap is on file
+
+ -- Agostino Russo <agostino.russo@gmail.com>  Tue, 03 Jun 2008 01:04:09 +0100
+
 pm-utils (1.1.2.2-1) unstable; urgency=low

   * New upstream release.
only in patch2:
unchanged:
--- pm-utils-1.1.2.2.orig/pm/module.d/uswsusp
+++ pm-utils-1.1.2.2/pm/module.d/uswsusp
@@ -49,8 +49,10 @@
 {
 	[ -f /sys/power/disk ] && \
 	grep -q disk /sys/power/state && \
-	[ -c /dev/snapshot ] &&
-	command_exists s2disk
+	[ -c /dev/snapshot ] && \
+	[ -e /proc/swaps ] && \
+	grep -qs "/.*[[:space:]]file[[:space:]]" /proc/swaps && \
+	command_exists s2disk
 }

 do_hibernate()
only in patch2:
unchanged:
--- pm-utils-1.1.2.2.orig/pm/module.d/kernel
+++ pm-utils-1.1.2.2/pm/module.d/kernel
@@ -16,7 +16,11 @@

 check_hibernate()
 {
-	[ -f /sys/power/disk ] && grep -q disk /sys/power/state
+	[ -f /sys/power/disk ] && \
+	grep -q disk /sys/power/state && \
+	[ -e /proc/swaps ] && \
+	grep -qs "/.*[[:space:]]file[[:space:]]" /proc/swaps
+
 }

 do_hibernate()

#484212#10
Date:
2008-06-03 06:30:59 UTC
From:
To:
ago wrote:

Hi Ago!

Do you have any references for this. Bug numbers etc? I'd like to know,
what the underlying problem is.

[..]

Thanks for the patch.

Cheers,
Michael

#484212#15
Date:
2008-06-03 23:01:41 UTC
From:
To:
Michael, the bug was submitted together with
https://bugs.launchpad.net/wubi/+bug/224697
You should find more info there.

PS patch patch (the above is not correct)


diff -u pm-utils-1.1.2.2/debian/changelog pm-utils-1.1.2.2/debian/changelog
--- pm-utils-1.1.2.2/debian/changelog
+++ pm-utils-1.1.2.2/debian/changelog
@@ -1,3 +1,9 @@
+pm-utils (1.1.2.2-2) hardy; urgency=low
+
+  * Disable hibernation if swap is on file
+
+ -- Agostino Russo <agostino.russo@gmail.com>  Tue, 03 Jun 2008 01:04:09 +0100
+
 pm-utils (1.1.2.2-1) unstable; urgency=low

   * New upstream release.
only in patch2:
unchanged:
--- pm-utils-1.1.2.2.orig/pm/module.d/uswsusp
+++ pm-utils-1.1.2.2/pm/module.d/uswsusp
@@ -49,8 +49,10 @@
 {
 	[ -f /sys/power/disk ] && \
 	grep -q disk /sys/power/state && \
-	[ -c /dev/snapshot ] &&
-	command_exists s2disk
+	[ -c /dev/snapshot ] && \
+	[ -e /proc/swaps ] && \
+	! grep -qs "/.*[[:space:]]file[[:space:]]" /proc/swaps && \
+	command_exists s2disk
 }

 do_hibernate()
only in patch2:
unchanged:
--- pm-utils-1.1.2.2.orig/pm/module.d/kernel
+++ pm-utils-1.1.2.2/pm/module.d/kernel
@@ -16,7 +16,11 @@

 check_hibernate()
 {
-	[ -f /sys/power/disk ] && grep -q disk /sys/power/state
+	[ -f /sys/power/disk ] && \
+	grep -q disk /sys/power/state && \
+	[ -e /proc/swaps ] && \
+	! grep -qs "/.*[[:space:]]file[[:space:]]" /proc/swaps
+
 }

 do_hibernate()

#484212#20
Date:
2008-08-01 08:58:44 UTC
From:
To:
That patch is not correct.
Suspend with a swap file does not work with plain swsusp v1. Using
uswsusp hibernating to a swap file is correctly handled. I don't know if
tuxonice work or not with swap files.

Bye,
Emilio

#484212#25
Date:
2009-02-09 23:47:58 UTC
From:
To:
Emilio Scalise schrieb:

ago,

could you please comment on this?
According to the tuxonice homepage, it supports suspend to a file and I
think Emilio is right, that uswsusp does too.

Do you have any references that suspend-to-file is not supported by
kernel-swsusp?

If so, could you rework the patch (based on 1.2.3 from experimental) and
 also update pm-is-supported, so apps like gnome-power-manager not even
try to suspend in such a case.

Cheers,
Michael

#484212#30
Date:
2023-12-21 17:56:09 UTC
From:
To:
Dear submitter,

as the package pm-utils has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see https://bugs.debian.org/1058701

The version of this package that was in Debian prior to this removal
can still be found using https://snapshot.debian.org/.

Please note that the changes have been done on the master archive and
will not propagate to any mirrors until the next dinstall run at the
earliest.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
ftpmaster@ftp-master.debian.org.

Debian distribution maintenance software
pp.
Thorsten Alteholz (the ftpmaster behind the curtain)