/etc/pm/sleep.d/ is no more processed

Bug #1455097 reported by Alex Muntada on 2015-05-14
54
This bug affects 9 people
Affects Status Importance Assigned to Milestone
aiccu (Ubuntu)
Undecided
Lars Düsing
ceph (Ubuntu)
Low
Unassigned
grub2 (Ubuntu)
Undecided
Unassigned
ifplugd (Ubuntu)
Undecided
Unassigned
lizardfs (Ubuntu)
Undecided
Unassigned
oss4 (Ubuntu)
Undecided
Unassigned
pm-utils (Ubuntu)
Medium
Unassigned
toshset (Ubuntu)
Undecided
Unassigned
unattended-upgrades (Ubuntu)
Undecided
Unassigned

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)

Alex Muntada (alex.muntada) wrote :
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in pm-utils (Ubuntu):
status: New → Confirmed
gubbins (dave-gittins) wrote :

Identical problems for me after upgrading Xubuntu to 14.04.

Changed in pm-utils (Ubuntu):
importance: Undecided → Medium
gubbins (dave-gittins) wrote :

sorry, I meant to say: identical problems for me after upgrading Xubuntu to 15.04 (not 14.04)

Martin Thornton (thornton-ma) wrote :

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.

Martin Thornton (thornton-ma) wrote :

https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/1458390 is probably a duplicate bug.

https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/1461386 is a related issue concerning calling pm-powersave on AC loss/connection.

Martin Thornton (thornton-ma) wrote :

Improved previous attachment. You'll also need to:
sudo cp [FILENAME] /lib/systemd/system-sleep/00powersave
sudo chown root.root /lib/systemd/system-sleep/00powersave
sudo chmod u+x /lib/systemd/system-sleep/00powersave

Alex Muntada (alex.muntada) wrote :

I moved my script to systemd, adapted it following Martin's instructions in comment #5 and it just works as expected.

Thanks a lot :)

Alex Muntada (alex.muntada) wrote :

On the other side I removed pm-utils from the system and there are a couple of remaining scripts in /etc/pm/sleep.d that are worth mentioning:

 * 10_grub-common
 * 10_unattended-upgrades-hibernate

Thus, those packages are also affected by this bug I guess.

summary: - pm-suspend.log and pm-powersave.log not updated since upgrade to vivid
+ pm-suspend no longer run since upgrade to vivid

Thanks Martin.

I'm confused why this isn't causing widespread problems for lots of users. I've got about 10 scripts in those folders which were installed by Ubuntu or various packages. Surely they did something useful? If I understand you rightly, they've all stopped getting run, for any user who has upgraded to vivid.

I don't know if I should try to convert them all, or remove them, or ignore them!

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in grub2 (Ubuntu):
status: New → Confirmed
Changed in unattended-upgrades (Ubuntu):
status: New → Confirmed
Martin Pitt (pitti) on 2015-07-10
no longer affects: unattended-upgrades (Ubuntu)
no longer affects: grub2 (Ubuntu)
Robie Basak (racb) wrote :

14:02 <rbasak> pitti: could you please take a look at bug 1455097? Alleged potential issues since systemd no longer uses /etc/pm/sleep.d/ but packages put stuff in there. Do we have the functionality we need provided for the systemd mechanisms also?

14:10 <pitti> rbasak: yes, I checked precise's apt-sources manpage, seems to be there

14:11 <pitti> rbasak: there is, one can put stuff into /lib/systemd/system-sleep/, but we don't actually want all the old pm-suspend quirks any more

14:12 <pitti> rbasak: so we could check which of the bits are really still needed, and link them from there

tags: added: systemd-boot
Robie Basak (racb) wrote :

So I think this should probably be Invalid or Won't Fix for pm-utils if the new mechanism should be /lib/systemd/system-sleep/, but we should have bug tasks for each package that used /etc/pm/sleep.d/ and still expects it to run, so I won't make that change yet.

ChristianEhrhardt (paelzer) wrote :

I did the task of identifying the remaining packages that are affected.

$ apt-file search /etc/pm/sleep.d/

aiccu: /etc/pm/sleep.d/60aiccu
ceph: /etc/pm/sleep.d/25-ceph
grub-common: /etc/pm/sleep.d/10_grub-common
ifplugd: /etc/pm/sleep.d/74ifplugd
lizardfs-chunkserver: /etc/pm/sleep.d/25-lizardfs-chunkserver
oss4-base: /etc/pm/sleep.d/30oss4-pm
toshset: /etc/pm/sleep.d/novatel_3g_suspend
unattended-upgrades: /etc/pm/sleep.d/10_unattended-upgrades-hibernate

I have renamed the bug and will assign all those packages here.
Those packages should then consider individually if they can drop their old pm quirk, migrate to /lib/systemd/system-sleep/ or chose a different way out.

summary: - pm-suspend no longer run since upgrade to vivid
+ /etc/pm/sleep.d/ is no more processed
Changed in pm-utils (Ubuntu):
status: Confirmed → Won't Fix

On 2016-04-06 17:46, ChristianEhrhardt wrote:
> I did the task of identifying the remaining packages that are affected.
>
> $ apt-file search /etc/pm/sleep.d/
>
> aiccu: /etc/pm/sleep.d/60aiccu

There has been a bug out for this for 4 years already that this should
never ever have existed:

 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689584

Short version: please remove any kind of trace from /etc/pm/sleep.d for
aiccu.

That should take care of your bug report for aiccu at least.

Greets,
 Jeroen

James Page (james-page) on 2016-06-30
Changed in ceph (Ubuntu):
status: New → Fix Committed
importance: Undecided → Low
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ceph - 10.2.2-0ubuntu2

---------------
ceph (10.2.2-0ubuntu2) yakkety; urgency=medium

  * d/ceph.install,d/etc/*: Drop pm based power management scripts as they
    are not used under systemd (LP: #1455097).
  * d/*: Split ceph-osd and ceph-mon into separate binary packages and add
    new ceph-base binary package inline with upstream packaging changes
    (LP: #1596063).
  * d/rules,*.{postinst,prerm}: Drop install and management of upstart
    configuration files; this package version onwards will only ever
    target >= Xenial, which is a systemd baseline.

 -- James Page <email address hidden> Thu, 14 Jul 2016 10:51:10 +0100

Changed in ceph (Ubuntu):
status: Fix Committed → Fix Released
Lars Düsing (lars.duesing) wrote :

aiccu package should be taken out of distribution due to closing of sixxs.net - there is no running tunnel broker any more.

Changed in aiccu (Ubuntu):
assignee: nobody → Lars Düsing (lars.duesing)
status: New → Invalid
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package unattended-upgrades - 0.98ubuntu1

---------------
unattended-upgrades (0.98ubuntu1) artful; urgency=medium

  * Merge from Debian unstable (LP: #1722426)
    - Remaining changes:
      - unattended-upgrades: Do not automatically upgrade the development
        release of Ubuntu unless Unattended-Upgrade::DevRelease is true.
    - Dropped changes, included in Debian:
      - Use lsb_release instead of dpkg-vendor in postinst

unattended-upgrades (0.98) unstable; urgency=medium

  * Rename test to test_non_minimal_steps_upgrade to reflect content
  * Catch SystemError while keeping apt lock unlocked (LP: #1632361)
  * Add --stop-only option to unattended-upgrade-shutdown and use it on
    hibernation. This prevents starting unattended-upgrades right before
    hibernating when Unattended-Upgrade::InstallOnShutdown is true.
    (Closes: #610333)
  * Stop already running unattended-upgrades before hibernation even with
    systemd (LP: #1455097)
  * Use lsb_release instead of dpkg-vendor in postinst (LP: #1719630)
  * Update README.md with the fact that unattended=upgrades is enabled
    by default (Closes: #865519)

 -- Balint Reczey <email address hidden> Tue, 10 Oct 2017 03:47:58 +0200

Changed in unattended-upgrades (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

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