Bug Description

* Unattended-upgrades does not gracefully stop installing updates when the system goes to hibernation potentially letting the system to hibernate in a state where the system can't resume from.

[Test Case (unattended-upgrades)]

* Configure the system to have several 20+ packages upgradable by unattended-upgrades. One easy way of setting this up is starting with a system where packages from -security are installed but packages from -updates are not and enabling -updates in u-u:

* Hibernate, then resume the system and watch unattended-upgrades being gracefully stopped, checking /var/log/unattended-upgrades/unattended-upgrades.log. There should be packages left to be upgraded.

[Regression Potential (unattended-upgrades)]

* The added hook for unattended-upgrades may block the system from hibernation for 25 minutes if unattended-upgrades (or most likely a package upgrades) hangs. There is a better solution proposed based on systemd's inhibitor interface at https://github.com/mvo5/unattended-upgrades/issues/162 .

[Original Bug Text]

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.

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:

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!

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

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.

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

* 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.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested and change the tag from verification-needed-xenial to verification-done-xenial. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-xenial. In either case, without details of your testing we will not be able to proceed.