Reproduced on trusty. In xenial the sleed.d packagekit hook is gone. sudo apt install pm-utils packagekit
I hacked /usr/lib/pm-utils/pm-functions to log which hook it was running, and forced a suspend with "pm-suspend". In my case I got multiple runs of 98video-quirk-db-handler right after the incorrect packagekit directory was hit: hook var is base is 99video runing hook /usr/lib/pm-utils/sleep.d/99video hook var is /usr/lib/pm-utils/sleep.d/99video base is 98video-quirk-db-handler runing hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hook var is /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler base is 95packagekit runing hook /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler hook var is /usr/lib/pm-utils/sleep.d/98video-quirk-db-handler base is 95led runing hook /usr/lib/pm-utils/sleep.d/95led hook var is /usr/lib/pm-utils/sleep.d/95led base is 95hdparm-apm ... With the proposed fix, the packagekit hook isn't run, and we also don't get double runs of other hooks. So the fix could be what is proposed, or/and moving the packagekit hook to the right place. -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to pm-utils in Ubuntu. https://bugs.launchpad.net/bugs/1548486 Title: Sleep hook in a subdirectory ignored but causes double execution of previous hook Status in pm-utils: Unknown Status in pm-utils package in Ubuntu: Confirmed Bug description: The set of sleep hooks provided in /usr/lib/pm-utils/sleep.d includes one (95packagekit/95packagekit) that is stored in a subdirectory. This has two effects: 1 the hook is not run; 2 the previous hook, currently /usr/lib/pm-utils/sleep.d/95led, is run for a second time instead. Presumably #1 is wrong, and results from an installation fault in packagekit, separately reported as bug 1548480. #2 occurs because the function run_hooks() in /usr/lib/pm-utils/pm- functions computes a list of to-be-executed hooks that includes directories but neither fully validates each such hook as a regular file nor handles a set of to-be-executed hooks in a subdirectory. At lines 243 on, there is a code path with no else clause through which the $hook from the previous iteration can be accidentally reused: if [ -f "$syshooks/$base" ]; then hook="$syshooks/$base" elif [ -f "$phooks/$base" ]; then hook="$phooks/$base" fi An easy fix is to insert the missing else clause before the fi line so that the script skips the subdirectory or other non-regular file and carries on with the next correctly specified hook: if [ -f "$syshooks/$base" ]; then hook="$syshooks/$base" elif [ -f "$phooks/$base" ]; then hook="$phooks/$base" else continue fi Observed in Lubuntu 14.04.3,4 with pm-utils 1.4.1-13ubuntu0.1,2. However the relevant pm-utils code dates back to 2008, pm-utils upstream version 1.1.0. ProblemType: Bug DistroRelease: Ubuntu 14.04 Package: pm-utils 1.4.1-13ubuntu0.2 [modified: usr/lib/pm-utils/pm-functions] ProcVersionSignature: Ubuntu 4.2.0-29.34~14.04.1-generic 4.2.8-ckt3 Uname: Linux 4.2.0-29-generic i686 ApportVersion: 2.14.1-0ubuntu3.19 Architecture: i386 Date: Mon Feb 22 17:10:53 2016 InstallationDate: Installed on 2016-02-21 (0 days ago) InstallationMedia: Lubuntu 14.04.4 LTS "Trusty Tahr" - Release i386 (20160217.1) 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/pm-utils/+bug/1548486/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp