Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Something is causing suspend crash occasionally. When it does crash, the system freezes with a black screen and stays on, not suspending. This makes me have to hold the power button until the system shuts down.

One setting difference I have from most people is, I don't use the option that lets you suspend when the laptop lid is closed. So opening and closing the laptop lid has no actions. I like to press suspend manually. Could this preference change be the cause?

How can I start looking for what's causing the crash, since the crash doesn't display errors?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

No, disabling the "suspend on lid close" function cannot affect manual suspend.

You would start by looking at the output of dmesg and the contents of /var/log/kern.log and /var/log/syslog for clues.

We can try to help if you share these with us. See this question for how:

How can I easily share the output of a command on a website?

share|improve this answer
    
Thanks. This is exactly what I needed –  Isaac Jul 1 '12 at 16:05

I don't think that setting you mention has anything to do with it.

Check /var/log/pm-suspend.log and see if it gives any hint.

These problems are usually due to some process(es) stopping the system from being suspended.

Do

dmesg -T|grep Freez -A4

and look for these entries:

--
[sun mar  3 15:19:48 2013] Freezing user space processes ... 
[sun mar  3 15:20:08 2013] Freezing of tasks failed after 20.01 seconds (3 tasks refusing to freeze, wq_busy=0):
[sun mar  3 15:20:08 2013] mount.nfs       D e8631aa0     0  5518   5517 0x00800004
[sun mar  3 15:20:08 2013]  e8631b10 00000086 f7bc0e00 e8631aa0 c1053cb4 c1809020 c192ee00 c192ee00
--

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, see man pm-suspend).

The script could look like this

#!/bin/sh
(killall -9 mount.nfs; exit 0)

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 run killall 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.

share|improve this answer
    
I also needed another line: (killall -9 mount.nfs; exit 0) because sometimes it doesn't work with SIGUP only. –  Juanin Apr 20 at 5:06
    
@Juanin: -9 is better, I don't know why I had only -1 in the first place, is edited now. –  Carl Apr 20 at 11:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.