[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2018-07-02 Thread Bug Watch Updater
** Changed in: pm-utils
   Status: Confirmed => Won't Fix

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1548392

Title:
  Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

To manage notifications about this bug go to:
https://bugs.launchpad.net/pm-utils/+bug/1548392/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2016-09-14 Thread Martin Pitt
** Changed in: pm-utils (Ubuntu)
 Assignee: Martin Pitt (pitti) => (unassigned)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1548392

Title:
  Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

To manage notifications about this bug go to:
https://bugs.launchpad.net/pm-utils/+bug/1548392/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2016-08-15 Thread Brian Murray
** Tags removed: rls-x-incoming

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1548392

Title:
  Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

To manage notifications about this bug go to:
https://bugs.launchpad.net/pm-utils/+bug/1548392/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2016-08-15 Thread Martin Pitt
pm-utils hasn't actually been used by the indicator/lid switch/etc.
desktop integration since the move to systemd. Thus this only affects
Ubuntu 14.04, and manually calling "pm-suspend" in later releases.

** Changed in: pm-utils (Ubuntu)
   Importance: Undecided => Critical

** Changed in: pm-utils (Ubuntu)
   Importance: Critical => Low

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1548392

Title:
  Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

To manage notifications about this bug go to:
https://bugs.launchpad.net/pm-utils/+bug/1548392/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2016-08-15 Thread Brian Murray
** Changed in: pm-utils (Ubuntu)
 Assignee: (unassigned) => Martin Pitt (pitti)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1548392

Title:
  Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

To manage notifications about this bug go to:
https://bugs.launchpad.net/pm-utils/+bug/1548392/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2016-08-12 Thread Dirk F
Marked bug 1394388 as duplicate of this. The bug report points out an
additional related symptom, as follows.

When issuing the pm-suspend command, the scripts set the HIBERNATE_MODE
in /sys/power/disk to "suspend".

There is some shell magic to save the previous setting in variable
HIBERNATE_MODE_SAVE, but this fails under the default shell /bin/dash
(works correctly with /bin/bash).

Effect: if you use pm-suspend once, the effective HIBERNATE_MODE in
/sys/power/disk stays in "suspend", and any subsequent pm-hibernate will
also just do a suspend instead of "platform" or "shutdown".

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1548392

Title:
  Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

To manage notifications about this bug go to:
https://bugs.launchpad.net/pm-utils/+bug/1548392/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2016-08-12 Thread Launchpad Bug Tracker
Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: pm-utils (Ubuntu)
   Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1548392

Title:
  Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

To manage notifications about this bug go to:
https://bugs.launchpad.net/pm-utils/+bug/1548392/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2016-02-22 Thread Bug Watch Updater
Launchpad has imported 5 comments from the remote bug at
https://bugs.freedesktop.org/show_bug.cgi?id=52572.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.


On 2012-07-27T07:25:40+00:00 Jskarvad wrote:

Created attachment 64764
Add support for in-kernel suspend to both.

>From kernel-3.6 there is in-kernel support for suspend to both (AKA
hybrid suspend).

Original report with patch from Bojan (also added as attachment):
https://bugzilla.redhat.com/show_bug.cgi?id=843657

Reply at: https://bugs.launchpad.net/ubuntu/+source/pm-
utils/+bug/1548392/comments/0


On 2012-10-17T14:39:31+00:00 Jskarvad wrote:

Created attachment 68712
Improved patch to save previous hibernation method

https://bugzilla.redhat.com/show_bug.cgi?id=866487

Reply at: https://bugs.launchpad.net/ubuntu/+source/pm-
utils/+bug/1548392/comments/1


On 2016-02-07T15:29:53+00:00 Dirk F wrote:

Comment on attachment 68712
Improved patch to save previous hibernation method

Review of attachment 68712:
-

In do_hibernate() the attempt to save and restore the active mode in
/sys/power/disk fails, causing "sh: I/O error" message in pm log
(attempting to write something that isn't one of the modes in
/sys/power/disk, namely an empty string). Instrumenting the function I
found that HIBERNATE_MODE_SAVE was never set.

The characters [] are special in a shell pattern (which is what follows
the ## and %% shell variable expansion modifiers) and have to be
escaped: \[ \].

The following works as you intended:

do_hibernate()
{
[ -n "${HIBERNATE_MODE}" ] && \
grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \
#df 2016-02-07 Shell patterns have to be escaped \[ \]! Fixes 
sh: I/O error when -z $HIBERNATE_MODE_SAVE 
HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \
HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*\[}" && \
HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%\]*}" && \
echo -n "${HIBERNATE_MODE}" > /sys/power/disk
echo -n "disk" > /sys/power/state
RET=$?
echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk
return "$RET"
}

Although you could make the penultimate line as follows I don't
recommend it because it would hide any problems like the escaping issue
that could cause HIBERNATE_MODE_SAVE to be invalid:

[ -n "$HIBERNATE_MODE_SAVE" ] && echo -n
"$HIBERNATE_MODE_SAVE" > /sys/power/disk

Reply at: https://bugs.launchpad.net/ubuntu/+source/pm-
utils/+bug/1548392/comments/2


On 2016-02-22T16:38:16+00:00 Dirk F wrote:

In comment #2 I wrote:
> Comment on attachment 68712 [details] [review]
>...
> Although you could make the penultimate line as follows I don't recommend it
> because it would hide any problems like the escaping issue that could cause
> HIBERNATE_MODE_SAVE to be invalid:
> 
>   [ -n "$HIBERNATE_MODE_SAVE" ] && echo -n "$HIBERNATE_MODE_SAVE" 
> >
> /sys/power/disk

In fact there are 2 cases as the code is used now:

1HIBERNATE_MODE unset => normal hibernate

2HIBERNATE_MODE = suspend => suspend-hybrid

Given which, I've revised my comment above and propose a new version of
the modified do_hibernate() as follows:

do_hibernate()
{
local hibernate_mode_save ret

[ -n "${HIBERNATE_MODE}" ] && \
 grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \
 hibernate_mode_save=$(cat /sys/power/disk) && \
 hibernate_mode_save="${hibernate_mode_save##*\[}" && \
 hibernate_mode_save="${hibernate_mode_save%%\]*}" && \
 [ "$hibernate_mode_save" != "${HIBERNATE_MODE}" ]  || \
 hibernate_mode_save=""
[ -n "$hibernate_mode_save" ] && \
 echo -n "${HIBERNATE_MODE}" > /sys/power/disk
echo -n "disk" > /sys/power/state
ret=$?
[ -n "$hibernate_mode_save" ] && \
 echo -n "$hibernate_mode_save" > /sys/power/disk
return $ret
}

The key points:
- hibernate_mode_save is only set if the current HIBERNATE_MODE is being 
changed (which only happens, if it does, in the suspend-hybrid case);
- on resume the hibernate mode is only restored if hibernate_mode_save was set.

This fixes:
- the failure to restore the hibernate mode with suspend-hybrid;
- "sh: I/O error" on resume from 

[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2016-02-22 Thread Bug Watch Updater
Launchpad has imported 5 comments from the remote bug at
https://bugs.freedesktop.org/show_bug.cgi?id=52572.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.


On 2012-07-27T07:25:40+00:00 Jskarvad wrote:

Created attachment 64764
Add support for in-kernel suspend to both.

>From kernel-3.6 there is in-kernel support for suspend to both (AKA
hybrid suspend).

Original report with patch from Bojan (also added as attachment):
https://bugzilla.redhat.com/show_bug.cgi?id=843657

Reply at: https://bugs.launchpad.net/ubuntu/+source/pm-
utils/+bug/1548392/comments/0


On 2012-10-17T14:39:31+00:00 Jskarvad wrote:

Created attachment 68712
Improved patch to save previous hibernation method

https://bugzilla.redhat.com/show_bug.cgi?id=866487

Reply at: https://bugs.launchpad.net/ubuntu/+source/pm-
utils/+bug/1548392/comments/1


On 2016-02-07T15:29:53+00:00 Dirk F wrote:

Comment on attachment 68712
Improved patch to save previous hibernation method

Review of attachment 68712:
-

In do_hibernate() the attempt to save and restore the active mode in
/sys/power/disk fails, causing "sh: I/O error" message in pm log
(attempting to write something that isn't one of the modes in
/sys/power/disk, namely an empty string). Instrumenting the function I
found that HIBERNATE_MODE_SAVE was never set.

The characters [] are special in a shell pattern (which is what follows
the ## and %% shell variable expansion modifiers) and have to be
escaped: \[ \].

The following works as you intended:

do_hibernate()
{
[ -n "${HIBERNATE_MODE}" ] && \
grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \
#df 2016-02-07 Shell patterns have to be escaped \[ \]! Fixes 
sh: I/O error when -z $HIBERNATE_MODE_SAVE 
HIBERNATE_MODE_SAVE=$(cat /sys/power/disk) && \
HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE##*\[}" && \
HIBERNATE_MODE_SAVE="${HIBERNATE_MODE_SAVE%%\]*}" && \
echo -n "${HIBERNATE_MODE}" > /sys/power/disk
echo -n "disk" > /sys/power/state
RET=$?
echo -n "$HIBERNATE_MODE_SAVE" > /sys/power/disk
return "$RET"
}

Although you could make the penultimate line as follows I don't
recommend it because it would hide any problems like the escaping issue
that could cause HIBERNATE_MODE_SAVE to be invalid:

[ -n "$HIBERNATE_MODE_SAVE" ] && echo -n
"$HIBERNATE_MODE_SAVE" > /sys/power/disk

Reply at: https://bugs.launchpad.net/ubuntu/+source/pm-
utils/+bug/1548392/comments/2


On 2016-02-22T16:38:16+00:00 Dirk F wrote:

In comment #2 I wrote:
> Comment on attachment 68712 [details] [review]
>...
> Although you could make the penultimate line as follows I don't recommend it
> because it would hide any problems like the escaping issue that could cause
> HIBERNATE_MODE_SAVE to be invalid:
> 
>   [ -n "$HIBERNATE_MODE_SAVE" ] && echo -n "$HIBERNATE_MODE_SAVE" 
> >
> /sys/power/disk

In fact there are 2 cases as the code is used now:

1HIBERNATE_MODE unset => normal hibernate

2HIBERNATE_MODE = suspend => suspend-hybrid

Given which, I've revised my comment above and propose a new version of
the modified do_hibernate() as follows:

do_hibernate()
{
local hibernate_mode_save ret

[ -n "${HIBERNATE_MODE}" ] && \
 grep -qw "${HIBERNATE_MODE}" /sys/power/disk && \
 hibernate_mode_save=$(cat /sys/power/disk) && \
 hibernate_mode_save="${hibernate_mode_save##*\[}" && \
 hibernate_mode_save="${hibernate_mode_save%%\]*}" && \
 [ "$hibernate_mode_save" != "${HIBERNATE_MODE}" ]  || \
 hibernate_mode_save=""
[ -n "$hibernate_mode_save" ] && \
 echo -n "${HIBERNATE_MODE}" > /sys/power/disk
echo -n "disk" > /sys/power/state
ret=$?
[ -n "$hibernate_mode_save" ] && \
 echo -n "$hibernate_mode_save" > /sys/power/disk
return $ret
}

The key points:
- hibernate_mode_save is only set if the current HIBERNATE_MODE is being 
changed (which only happens, if it does, in the suspend-hybrid case);
- on resume the hibernate mode is only restored if hibernate_mode_save was set.

This fixes:
- the failure to restore the hibernate mode with suspend-hybrid;
- "sh: I/O error" on resume from 

[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2016-02-22 Thread Brian Murray
** Bug watch added: freedesktop.org Bugzilla #52572
   https://bugs.freedesktop.org/show_bug.cgi?id=52572

** Also affects: pm-utils via
   https://bugs.freedesktop.org/show_bug.cgi?id=52572
   Importance: Unknown
   Status: Unknown

** Tags added: rls-x-incoming

** Tags removed: package-from-proposed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1548392

Title:
  Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

To manage notifications about this bug go to:
https://bugs.launchpad.net/pm-utils/+bug/1548392/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1548392] Re: Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

2016-02-22 Thread Brian Murray
** Bug watch added: freedesktop.org Bugzilla #52572
   https://bugs.freedesktop.org/show_bug.cgi?id=52572

** Also affects: pm-utils via
   https://bugs.freedesktop.org/show_bug.cgi?id=52572
   Importance: Unknown
   Status: Unknown

** Tags added: rls-x-incoming

** Tags removed: package-from-proposed

-- 
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to pm-utils in Ubuntu.
https://bugs.launchpad.net/bugs/1548392

Title:
  Fix for 1172692 fails to restore hibernation mode with suspend-hybrid

To manage notifications about this bug go to:
https://bugs.launchpad.net/pm-utils/+bug/1548392/+subscriptions

-- 
Ubuntu-server-bugs mailing list
Ubuntu-server-bugs@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server-bugs