hibernate item does not show up in menu when no swap active

Bug #1082906 reported by Yann E. MORIN
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
policykit-1 (Ubuntu)
New
Undecided
Unassigned

Bug Description

When no swap is active, the 'hibernate' item does not show up in the /system/ menu.

I manually verified that hibernation works on my machine (using pm-hibernate), and it does.

As I am using an SSD, I do not use any swap at all (I have enough RAM).

However, I have an inactive swap partition that gets activated by a pm hook:
> cat /etc/pm/sleep.d/00-swap
> #!/bin/sh
>
> swap_device="$( awk '$0 ~ /^#/ { next; }
> $3=="swap" {
> printf( "%s\n", $1 );
> }' /etc/fstab )"
>
> case "${1}" in
> hibernate)
> # Create and activate a clean swap
> mkswap "${swap_device}"
> swapon "${swap_device}"
> ;;
> thaw)
> swapoff "${swap_device}"
> # Forget the old SWSUSP image after resuming
> dd if=/dev/zero of="${swap_device}" bs=1048576 count=4
> ;;
> esac

Note: I need to cleanup the previous SWSUSP image, so the kernel does not pick it up after a normal, non-hibernate boot.

If I manually activate the swap partition, then 'hibernate' shows up in the system menu. If the swap partition is not active, but only formatted, hibernate is not available; the swap has to be active.

It somehow makes sense to disable hibernate if there is no swap, but using swap on an SSD risks wearing out the SSD very fast.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: policykit-1 0.104-2ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-18.29-generic 3.5.7
Uname: Linux 3.5.0-18-generic i686
ApportVersion: 2.6.1-0ubuntu6
Architecture: i386
Date: Sun Nov 25 16:18:49 2012
InstallationDate: Installed on 2012-04-26 (212 days ago)
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release i386 (20120423)
MarkForUpload: True
ProcEnviron:
 SHELL=/bin/bash
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 XDG_RUNTIME_DIR=<set>
SourcePackage: policykit-1
UpgradeStatus: Upgraded to quantal on 2012-11-24 (0 days ago)

Revision history for this message
Yann E. MORIN (yann-morin-1998-r) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.