1

I found some differences between running pm-suspend and clicking "Suspend" menu item in LXDE on Ubuntu 16.04

  1. In both cases I can wake up Ubuntu by pushing the power button on my laptop, but in the way by "Suspend" menu item in LXDE, I have to provide my password to unlock the screen, while in the way by pm-suspend (and bypm-hibernate or pm-suspend-hybrid), I don't need to.

  2. According to this question How do I run commands on suspend/return from suspend? | Super User, scripts under /usr/lib/pm-utils/sleep.d/ and /etc/pm/sleep.d/ are supposed to be executed upon suspension/hibernation and resuming/thawing. But it is true only when I run pm-suspend (orpm-hibernate or pm-suspend-hybrid), and false when I click "Suspend" menu item in LXDE.

I used to use Gnome, and I remember it was the same as in LXDE, except Gnome might have hibernate option besides suspend.

I wonder why there are the differences between suspension by the DEs and by pm-utils?

Can pm-suspend be used in a way so that resume requires password to unlock the screen?

Can "suspend" menu item in LXDE be used in a way so that the scripts in /usr/lib/pm-utils/sleep.d/ and /etc/pm/sleep.d/ are executed upon suspension/hibernation and resuming/thawing?

Thanks.

Tim
  • 98,580
  • 191
  • 570
  • 977
  • Like you mentioned in your comment on https://unix.stackexchange.com/a/485056/281844, this might be the difference between `pm-suspend` and `systemctl suspend`... Can you try if when you run `systemctl suspend` everything works as expected? (i.e. screen gets locked and requires password to unlock?) You can inspect the systemd hook directory (`/usr/lib/systemd/sleep/`) to see if it's populated with hooks but even better look if there are any inhibitors in place with [`systemd-inhibit --list`](https://www.freedesktop.org/software/systemd/man/systemd-inhibit.html) to check. – filbranden Nov 30 '18 at 03:39
  • @FilipeBrandenburger Thanks. I appreciate if you could consider https://unix.stackexchange.com/questions/485593/why-is-my-script-not-executed-when-waking-up-from-systemd-suspension – Tim Dec 03 '18 at 00:41

0 Answers0