← Back to team overview

desktop-packages team mailing list archive

[Bug 1455097] Re: pm-suspend.log and pm-powersave.log not updated since upgrade to vivid

 

Was caused by switch to systemd from upstart.  Instead of pm-suspend,
systemd uses systemd-sleep.  Instead of running scripts in
/etc/pm/sleep.d/ and /usr/lib/pm-utils/sleep.d/ it runs scripts in
/lib/systemd/system-sleep/.  However, no script is installed here to
call pm-powersave, and systemd doesn't seem to have an alternative to
it, so I added my own.

For example, I converted the /usr/lib/pm-utils/sleep.d/00powersave as
follows:

###UPSTART:
#!/bin/sh
. "${PM_FUNCTIONS}"
ARCH=`uname -m`
command_exists pm-powersave || exit $NA
case $1 in
    suspend|hibernate) [ "$ARCH" != "${ARCH#arm}" ] || pm-powersave false ;;
    resume|thaw)       pm-powersave ;;
    *) exit $NA ;;
esac
exit 0

###SYSTEMD:
#!/bin/sh
case $1 in
    post)       pm-powersave ;;
    *) [ "$ARCH" != "${ARCH#arm}" ] || pm-powersave false ;;
esac
exit 0


It was necessary to remove the lines:
> . "${PM_FUNCTIONS}"
> command_exists pm-powersave || exit $NA
and note that parameters to script differ, see man systemd-sleep.  


** Attachment added: "pm-powersave hook for systemd, save as /lib/systemd/system-sleep/00powersave"
   https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/1455097/+attachment/4422954/+files/00powersave

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

Title:
  pm-suspend.log and pm-powersave.log not updated since upgrade to vivid

Status in pm-utils package in Ubuntu:
  Confirmed

Bug description:
  I added a new script in /etc/pm/sleep.d/ that worked fine before the
  upgrade to vivid. I was wondering why it doesn't work and I find out
  that /var/log/pm-suspend.log is empty, and pm-powersave.log too (last
  logs from pm-suspend were on Apr 28, when I upgraded from utopic to
  vivid.

  The laptop suspends and wakes fine, it just seems that no pm scripts
  are run after suspend/powersave.

  ProblemType: Bug
  DistroRelease: Ubuntu 15.04
  Package: pm-utils 1.4.1-15
  ProcVersionSignature: Ubuntu 3.19.0-16.16-generic 3.19.3
  Uname: Linux 3.19.0-16-generic x86_64
  ApportVersion: 2.17.2-0ubuntu1
  Architecture: amd64
  CurrentDesktop: Unity
  Date: Thu May 14 15:36:26 2015
  DistributionChannelDescriptor:
   # This is a distribution channel descriptor
   # For more information see http://wiki.ubuntu.com/DistributionChannelDescriptor
   canonical-oem-somerville-precise-amd64-20120703-2
  EcryptfsInUse: Yes
  InstallationDate: Installed on 2013-03-12 (792 days ago)
  InstallationMedia: Ubuntu 12.04 "Precise" - Build amd64 LIVE Binary 20120703-15:08
  PackageArchitecture: all
  SourcePackage: pm-utils
  UpgradeStatus: No upgrade log present (probably fresh install)

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


References