Suspend not reading /etc/pm/sleep.d - What is the used system command for suspending?
#1
I updated my setup slightly - built in a new SDD-drive, went for lubuntu 16.04.3 LTS and so on.
I now have my box more or less running but I am having a problem for suspending it.
Actually with pm-suspend my machine suspends and resumes just fine. I also have everything ready for tvheadend recording.

My only problem is that when I shutdown the machine from menu with suspend it suspends (somehow) but it is not reading my
file in /etc/pm/sleep.d

What is the system command for suspend that is used by kodi to put the machine in sleep?

I have something like this in /etc/pm/sleep.d/100resume:
#!/bin/bash
 case $1 in
     hibernate)
          date
          echo "Hey honey, we are going to suspend to disk!"
          ;;
     suspend)
          echo "Oh, this time we're doing a suspend to RAM. Cool!"
          ;;
     thaw)
          date
          echo "oh, suspend to disk is over, we are resuming..."
          ;;
     resume)
          date
          echo "hey, the suspend to RAM seems to be over..."
          ;;
      *)  
          date
          echo "somebody is calling me totally wrong."
        ;;
esac

When I give manually the pm-suspend I get the correct actions and I get the stuff in /var/log/pm-suspend
When I execute the suspend from kodi I get nothing (not even pm-hibernate or so)
Reply
#2
it will use upower or logind via dbus, depending on what is available. The Debug Log will tell you
Reply
#3
Can I set it to some method that reads the /etc/pm/sleep.d files?
Reply
#4
(2018-01-07, 21:28)wsnipex Wrote: it will use upower or logind via dbus, depending on what is available. The Debug Log will tell you
 ^^
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#5
Since it's Ubuntu 16.04, it's probably using logind. systemd-logind runs scripts in here on sleep/wake: /lib/systemd/system-sleep.
Reply
#6
Ok here is the log after reboot and suspend:
https://pastebin.com/RAuqBZPd

I performed suspend at 06:43:08:
06:43:08 T:140023188572608   DEBUG: LogindUPowerSyscall: Received PrepareForSleep with arg 1

I included the previous stuff as well, because there was something like:
06:42:38 T:140023188572608   ERROR: DBus: Error org.freedesktop.DBus.Error.InvalidArgs - No such property 'CanSuspend'

Well the suspend itself works ok, except I want to shutdown tvheadend before suspend
and I want to carry out some actions after resume (like checking if it woke up for recording etc.)
for these reasons I need something like /etc/pm/sleep.d/100resume file.
If I can modify the used method accordingly it's also ok for me.

What I am wondering is that I had previously Medibuntu with 14.04 LTS and I used the same /etc/pm/sleep.d/100resume file and everything worked ok. The file got used by suspend and
so on. I also hat kodi 17.6 so what gives, where is the difference?
Reply
#7
the difference is ubuntu 16.04 uses systemd incl logind.
Reply
#8
Ok, apparently I need to migrate my stuff into
/lib/systemd/system-sleep/  instead of /etc/pm/sleep.d
should be straigth-forward (crossing my fingers here)

Another question: system powerdown or shutdown is not handled here? For setting a wake-up timer
I would need an additional script in
Code:
/lib/systemd/system-shutdown/

am I right?
Not many how-tos hanging around for that...
Reply

Logout Mark Read Team Forum Stats Members Help
Suspend not reading /etc/pm/sleep.d - What is the used system command for suspending?0