In the power management, I selected the option called "suspend when I close the lid". If I close the lid, the computer is not suspending. It keep itself on. How can I solve this problem?
Ubuntu – How to make “suspend” option work
suspend
suspend
In the power management, I selected the option called "suspend when I close the lid". If I close the lid, the computer is not suspending. It keep itself on. How can I solve this problem?
Best Answer
This usually happens when some process stops the system from being suspended.
Do
and look for these entries:
Check the time stamps to see which of the reported problems relate to your try to suspend. In this case, it is
mount.nfs
that is causeing the problems.Now, put a script in
/etc/pm/sleep.d/
, scripts there will be run at suspend and resume. The file name should start with an ordering number, 00-49 for user scripts (for more details, seeman pm-suspend
).The script could look like this
with correpsonding entries for other processes that caused problems, if any.
Parenthesis and
exit 0
is a trick: if the process isn't found,killall
will exit with exit code 1, which will cancel the entire suspend. The above will runkillall
in a sub-shell that will exit with 0.If you're having problems, check
/var/log/pm-suspend.log
that will log the attempt to suspend and to run your script.