Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: pm-suspend works, but just plain closing the lid to suspend usually doesn't.

  1. #11
    Join Date
    Dec 2012
    Beans
    Hidden!

    Re: pm-suspend works, but just plain closing the lid to suspend usually doesn't.

    1. Make sure pm-suspend is working on your system. You may also need to sudo first. Some services can prevent a system from going to Suspend.

    2. There's also the possibility your machine is using another event name for the lid.

    Close and reopen the lid whilst running in a x-terminal:

    Code:
    acpi_listen
    This will capture the actual string of acpi events passed from your hardware when you close the lid and reopen it. The string generated needs to be passed to the event=XXX in the lid file.

  2. #12
    Join Date
    Jan 2009
    Location
    Santander, Spain
    Beans
    1,645
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: pm-suspend works, but just plain closing the lid to suspend usually doesn't.

    It is very strange.

    Only if I open a xterm and execute the command you provided:
    Code:
    acpi_listen
    and then close the lid, the computer suspends, and acpi_listen command returns:
    Code:
    clara@clara1:~$ acpi_listen
    button/lid C154 00000080 00000001
    video C099 00000080 00000000
    thermal_zone TZ1 00000081 00000000
    thermal_zone TZ3 00000081 00000000
    button/lid C154 00000080 00000002
    pm_suspend has always worked on my computer (of course, using sudo), also the suspension button in the upper panel.

    So the conclusion is, the workaround for suspension when close lid, works only if I execute the command acpi_listen, but no in other case ???

  3. #13
    Join Date
    Dec 2012
    Beans
    Hidden!

    Re: pm-suspend works, but just plain closing the lid to suspend usually doesn't.

    Please understand the point. The reason to use acpi_listen is to get the trigger for the event.

    In your case it is:

    CLOSE
    Code:
    button/lid C154 00000080 00000001
    and OPEN
    Code:
    button/lid C154 00000080 00000002
    So put in the file /etc/acpi/events/lid

    Code:
    event=button/lid C154 00000080 00000001
    action=/usr/sbin/pm-suspend

  4. #14
    Join Date
    Jan 2009
    Location
    Santander, Spain
    Beans
    1,645
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: pm-suspend works, but just plain closing the lid to suspend usually doesn't.

    Okay, I have done as you say:

    /etc/acpi/events/lid file :
    Code:
    event=button/lid C154 00000080 00000001
    action=/usr/sbin/pm-suspend
    I try to run the file but I obtain:

    clara@clara1:/etc/acpi/events$ lid
    El programa «lid» puede encontrarse en los siguientes paquetes:
    * id-utils
    * libuser
    Intente: sudo apt-get install <paquete seleccionado>
    Translation:
    Program lid can be found in the following packages:
    * id-utils
    * libuser
    Try: sudo apt-get install "selected package"

    What am I doing wrong?, lid file has to be a bash script and beginning by #! /bin/bash?

    As it is clear, lid file is executable by anybody in /etc/acpi/events/:

    Code:
    -rwxr-xr-x 1 root root   68 dic 18 13:53 lid
    Tankyou for your patience

  5. #15
    Join Date
    Dec 2012
    Beans
    Hidden!

    Re: pm-suspend works, but just plain closing the lid to suspend usually doesn't.

    Why are you running the file? It should have +x attributes but you don't run the file.
    Leave the file in the /etc/acpi/events directory. The acpid/service will run the action if it detects the lid event.

  6. #16
    Join Date
    Jan 2009
    Location
    Santander, Spain
    Beans
    1,645
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: pm-suspend works, but just plain closing the lid to suspend usually doesn't.

    Okay, now is working, and certainly it is not necessary to put the #! /bin/bash "title" in the beginning of the file or to manually run the file. For me the problem is solved.

    I was trying to run the file because when close lid before it wasn't recognized, and computer didn't suspend. I suppose it was for the "LID close" order insted of the good one for me "C154 00000080 00000001".

    Thankyou for your help.

    I dare to ask to the original poster to mark the thread as "solved", since the workaround propossed by os2 works.

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •