My Ubuntu 14.04 on Thinkpad T400 sometimes (but not always) can't wake up from suspension.

While I am still suspecting my graphic controller's driver, I found two scripts (here and here). I don't understand why they work.

  1. Are there commands in the scripts that do the jobs of suspension and of waking up? I don't find them.

  2. Why is one script stored in /etc/pm/sleep.d/fglrx-fix, and the other in /etc/pm/sleep.d/99_wake_hack?

  3. What in the scripts that make the waking up succeed? By switching to a text console upon waking up, and switch to the graphic console (Ctrl-Alt-F7) after waking up?

  1. The scripts are checking the first argument($1) they are given by the OS to inform them if the computer is sleeping or resuming in their case conditionals.

  2. Almost all distros look for hooks(scripts) in /etc/pm/sleep.d/ to execute on sleep or resume. The scripts you found do not run the process of sleeping or resuming, they just "hook" to the process.

  3. Yes. Strangely enough changing virtual terminals(chvt) seem to work here, though I don't know why. Perhaps another answer will come explaining why.

  • Thanks. Is there some rule of naming the self-added script in /etc/pm/sleep.d/? – Tim Apr 4 '15 at 19:29
  • Seemingly not, looking at the names of scripts given. – sikerbela Apr 4 '15 at 19:31
  • In what order are the scripts there run? (I think the order matters?) – Tim Apr 4 '15 at 19:37
  • The ubuntu manpage for pm-action says C sort order, though I am not sure what it is. – sikerbela Apr 4 '15 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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