Comment 5 for bug 1455097

Revision history for this message
Martin Thornton (thornton-ma) wrote : 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.