I have managed to get this working on my system. I'm pretty sure it was because I was using symbolic links.
I regularly backup my /home
, but nothing else. In order to catch the few scripts I've modified in /etc
I use a directory off my home dir and I then add a symlink in the /etc
location.
In this case, the script which walks through these directories is checking that the file exists and is a "regular file":
if [ -f "$syshooks/$base" ]; then hook="$syshooks/$base"
As a result, my scripts were not being considered at all. By copying them directly into /etc/pm/sleep.d
they are all called correctly.