I found some differences between running pm-suspend and clicking "Suspend" menu item in LXDE on Ubuntu 16.04
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-hibernateorpm-suspend-hybrid), I don't need to.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 runpm-suspend(orpm-hibernateorpm-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.
pm-suspendandsystemctl suspend... Can you try if when you runsystemctl suspendeverything 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 withsystemd-inhibit --listto check.