The ACPI LID close event catched only 50% of the time.

I'm using acpid with s2ram to have my laptop suspend to ram when I close the lid.
This works fine... 50% of the time.
Here is what happen:
If the s2ram command is commented in my /etc/acpi/actions/lid.sh, and I run an acpi_listen in a terminal, I can see that each time I close or open the lid, the last number is incremented by 1:
button/lid LID 00000080 00000001
button/lid LID 00000080 00000002
button/lid LID 00000080 00000003
button/lid LID 00000080 00000004
button/lid LID 00000080 00000005
If the s2ram is NOT commented in my /etc/acpi/actions/lid.sh and I run acpi_listen in a terminal, here is what I see (we start the test with the lid opened):
1) I close the lid. The acpi_listen shows:
button/lid LID 00000080 00000001
2) The s2ram is executed and the laptop suspends to ram. That is fine.
3) I open the lid. The laptop resumes fine. Nothing happens in the acpi_listen output.
4) The /proc/acpi/button/lid/LID/state shows "open"
Here after is where the problem is:
5) I close the lid. The acpi_listen DOES NOT SHOW ANYTHING :-(  => The /etc/acpi/actions/lid.sh will not be launched and the laptop will not be suspended
6) The /proc/acpi/button/lid/LID/state shows "close"
7) I open the lid. The acpi_listen shows:
button/lid LID 00000080 00000002  => As one can see the last number is now 00000002 which shows that the acpid daemon never received anything for the second lid closure  :-(
8) I close the lid. The acpi_listen shows:
button/lid LID 00000080 00000003
2) The s2ram is executed and the laptop suspends to ram. That is fine.
So in fact it works the first time then I need to close/open/close the lid to have it suspend.
Any idea ?
Thanks in advance,

Solved it by adding a file to /etc/pm/sleep.d/80-acpid with:
#!/bin/sh
case "$1" in
hibernate|suspend)
thaw|resume)
/etc/rc.d/acpid restart
*) exit $NA
esac
You have to call pm-suspend or hibernate followed by an ampersand (&) otherwise the acpid restart fails.
EDIT: Sorry for the necro. Thought it was 2012. Either way I solved my problem with this so someone else might find it useful.
Last edited by Revolt (2012-02-28 22:49:53)

Similar Messages

  • KDE4 "When lid closed" event problem

    Hi,
    i'm using updated Arch Linux system with KDE4. My problem is, that KDE Power Manager does not hear on lid close event. I can choose everything from menu (suspend, lock screen, ...) but it does nothing. After closing the lid, system follows "Do nothing" option.
    Few weeks ago, everything was fine - closing the lid raised sleep action.
    Last week i set up "Do nothing" option for lid close event and today i'm not capable to return sleep option back.
    I can sleep computer from menu or with 'systemd sleep' command. I have everything commented out in /etc/systemd/logind.conf.
    Thank you for help.
    j.
    EDIT: I have another problem. When I turn off AC adapter, status icon of batery does not change. My notebook thiks, that is still on-line on AC. Something is wrong and i'm afraid that is HW issue.
    EDIT: I have found some warnings in dmesg. What does it mean?
    [ 8.891349] ACPI: Battery Slot [BAT1] (battery present)
    [ 8.896149] ACPI Warning: 0x0000000000000428-0x000000000000042f SystemIO conflicts with Region \PMIO 1 (20130725/utaddress-251)
    [ 8.896157] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
    [ 8.896161] ACPI Warning: 0x0000000000000530-0x000000000000053f SystemIO conflicts with Region \GPIO 1 (20130725/utaddress-251)
    [ 8.896165] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
    [ 8.896166] ACPI Warning: 0x0000000000000500-0x000000000000052f SystemIO conflicts with Region \GPIO 1 (20130725/utaddress-251)
    [ 8.896169] ACPI: If an ACPI driver is available for this device, you should use it instead of the native driver
    Last edited by juray (2014-01-31 09:16:05)

    OK, I am victim of this BUG
    https://bugzilla.kernel.org/show_bug.cgi?id=44161
    Don't buy Samsung ultrabooks. They seems to be only Win8 compatible

  • [SOLVED] Power button and laptop lid close rules not followed (KDE)

    I'm using KDE 4.9.1, and the rules I set for the power button and lid close events in the KDE power management settings are not followed.
    Currently, I have the power button press event set to trigger hibernation, and the lid close event set to turn off the display. Instead, the power button causes the laptop to power down immediately, as if the 'poweroff' command was issued. Closing the lid causes the system to suspend to ram.
    This problem seemed to have started when I installed 'laptop-mode-tools' and 'acpid'. The problem persisted even when I uninstalled the said packages from the system. Most solutions on the internet involve adjusting the contents of files in /etc/acpi/, but that directory does not exist on my system. I also tried deleting the power management configuration files in the ~/.kde4/share/config directory, but that didn't fix the problem either.
    Hibernation works if I choose 'hibernate' from the KDE menu.
    Thanks for any help.
    Last edited by rb3 (2012-09-28 05:46:56)

    That's not a good solution.
    Changes in systemd default behaviour are reasonable. It guarantees that if your graphical enviroment has no suspend support, it will still suspend when the lid is closed.
    For example, closing the laptop lid at KDM login screen will now suspend the laptop. I remember a topic when someone nearly killed his notebook battery with overheat in that situation (the laptop did not suspend when the lid was closed at kdm screen).
    This change also brings native (non-acpid) suspend support to lighweight desktop enviroments.
    The source of the «double suspend» problem is in acynchronized update of systemd and KDE.
    Updating KDE to 4.9.2 (which will be released in several days) will fix this without editing the config file.
    Make sure you restore the original logind.conf after updating to KDE 4.9.2.
    See:
    http://lists.freedesktop.org/archives/s … 06604.html
    https://bugs.kde.org/show_bug.cgi?id=307412
    https://git.reviewboard.kde.org/r/106533/

  • How to detect an external application close event?

    Hello,
    I have an executable running at startup (scheduled task) and always
    staying alive on my server. When the server is rebooted, I would like
    to take some actions (write in a event log, etc) before my application
    is closed by windows.
    So how can I detect that Windows is closing and that it's time to do the associate actions before the closing.
    I've tried the 'Application close event' in an event loop but doesn't seems to work.
    I'm using labview 8.2 on Windows server 2003.
    Thanks in advance!!
    Vincent

    I tied this and it did capture the application close event.  What I did was while running LabVIEW in developer mode I used Windows Task Manager to kill the process.  It did throw an Application Close event.  I don't have time to try other cases like shutdown or what happens if it is an EXE but hope this helps.
    Matthew Fitzsimons
    Certified LabVIEW Architect
    LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
    Attachments:
    appClose.vi ‏13 KB

  • ToolBoxTools.addEventListener only works every second time

    Hi!
    Our layouts pretty often click on the "page tool" by mistake and it happened a few times, that they changes the size of the page without even noticing. Because there is no way to remove the tool from the toolbar (I guess?), I wanted to write a script, that at least shows a message, that the page tool ("Seitenwerkzeug" in german) was selected. Unfortunately the event listener only works every second time:
    1. indesign starts > selection tool is active
    2. click on page tool > message appears > page tool is active
    3. click on "another tool1" > "another tool1" is active
    4. click on "another tool2" > "another tool1" is active
    5. click on page tool > nothing happens, the icon of the page tool is active, but the icon of the "another tool2" is still active, too, and "another tool2" is still activated
    6. click on "another tool3" > "another tool3" is active
    7. click on page tool > message appears > page tool is active
    8. ......
    Any idea why that is?
    My script:
    #targetengine myToolListener
    app.toolBoxTools.addEventListener ("afterAttributeChanged", changeToolAlert);
    function changeToolAlert() {
        if(app.toolBoxTools.currentToolName == "Seitenwerkzeug") {
            alert ("Message", "Title");
        exit(); //i tried with and without this!
    At the beginning I tried to use an confirm message instead of an alert, which had the same problem and I thought it might be because the changing doesn't work... but it seems I can't even work with the information without something "crashing" in the background?
    My previous confirm Function:
    function changeToolConfirm() {
        if(app.toolBoxTools.currentToolName == "Seitenwerkzeug") {
            var confirmDialog = confirm("Do you really want to activate the page tool?", true);
            if(!confirmDialog) {
                app.toolBoxTools.currentTool = UITools.SELECTION_TOOL;
    I really hope someone has an idea
    Best,
    Anke

    Hi Anke,
    The problem, I think, comes from the fact that the Page Tool selection event (which you listen to via afterAttributeChanged) needs some time to complete. Since the alert() or confirm() instruction gives the focus to a new modal window before the event life-cycle is finished, the GUI becomes instable, the PageTool icon state is not properly restored, and your event management goes wrong.
    A way to solve this might be to queue a temporary IdleEvent listener once the Page Tool selection event is caught. That is, we do not initiate any modal dialog as long as the GUI is refreshing.
    Something like this:
    //====================================================
    // PageToolDisclaimer.jsx
    //====================================================
    // Should be useable as a startup script, no #targetengine required
    // NB - MutationEvent is known to create a global 'evt' variable
    // so we don't seem to need a persistent session engine here :-)
    // That's why the active script File is used as the event handler
    (function(/*File*/EVENT_HANDLER, /*str*/TASK_NAME, /*uint*/TASK_TIME, /*str*/PAGE_TOOL_NAME)
        var t;
        // Installer
        if( !(t=app.toolBoxTools.eventListeners).length )
            t.add(MutationEvent.AFTER_ATTRIBUTE_CHANGED, EVENT_HANDLER);
            return;
        // IdleEvent handler (--> confirm)
        if( (t=app.idleTasks.itemByName(TASK_NAME)).isValid )
            t.eventListeners.everyItem().remove();
            t.remove();
            if( !confirm("***WARNING***\rDo you really want to activate the page tool?", true) )
                app.toolBoxTools.currentTool = UITools.SELECTION_TOOL;
            return;
        // PageTool event handler
        if( ('evt' in $.global) && 'currentToolName'==evt.attributeName && PAGE_TOOL_NAME==evt.attributeValue )
            evt.stopPropagation();
            app.idleTasks.add({name:TASK_NAME, sleep:TASK_TIME})
                  .addEventListener(IdleEvent.ON_IDLE, EVENT_HANDLER);
    })(app.activeScript, 'WaitPageTool', 400, app.translateKeyString('$ID/Page Tool'));
    Hope that helps.
    @+
    Marc

  • MacBook restarts to blue background when the lid closes-only sometimes????

    My Mac has done this periodically since six months after I've bought it. When I close the lid, I hear the restart tone and when I open it back up it's going through a restart process. Most of the time, it starts back up with a blue background (not the normal picture I have as my background) and I'm unable to drag and drop items from an open program to a folder or the desktop (unable to drag a picture from iphoto to the desktop). To remedy the situation, all I have to do is restart the computer normally and it returns to a normal desktop.
    I called Apple and they first ad me do an archive and install, which I did with no results (the problem still occurred at least once a day) and then an erase and install which reduced the frequency of the problem but did not eliminate it. I also sent the computer in to the Apple Depot where the replaced the top case, the power management unit, and the heat sync but did nothing software wise. When I got the computer back, I again did an erase and install and the problem is still occurring a couple times a week.
    Anyone have any idea on what's going on? Should I keep harassing Apple Care? Will it do any good? I'm about to buy 10.5, but will this fix it? Help!

    Bump

  • Acpi HP6710b lid close bug

    Common problem with HP6710b is to froze on lid close.
    I found on arch wiki solution for this crap....
    echo "1" >  /proc/acpi/video/C098/DOS
    I need to place this command on startup.... but where?
    During run rc.local  /proc/acpi/video/C098/DOS does not exists

    Would surprise me. Does it work when your computer is up and running? Replacing the C098 by an asterisk should do the job too I think, since that value can differ between models. Even better is replacing that value by the one your system uses .

  • Only two events catching

    Hi All!
    I'm an absolute beginner in making programs to SBO.
    I wrote any little trial program in VB6 (and Delphi5), but I have a problem the events handling (of course...).
    By the samples I use the code as below:
    Private Sub SBO_Application_ItemEvent(ByVal FormUID As String, pVal As SAPbouiCOM.IItemEvent, BubbleEvent As Boolean)
        If pVal.FormType <> 0 Then
            Select Case pVal.EventType
                Case et_ITEM_PRESSED:
                    SBO_Application.MessageBox ...
                Case et_KEY_DOWN:
                    SBO_Application.MessageBox ...
                Case et_GOT_FOCUS:
                    SBO_Application.MessageBox ...
                Case et_FORM_LOAD:
                    SBO_Application.MessageBox ...
                Case etc...           
            End Select
        End If
    End Sub
    Every time only two event catching: et_GOT_FOCUS and et_FORM_LOAD after the start, and not others.
    How can I get to catch the et_ITEM_PRESSED (there is a button on the form), etc. event?
    (Note1: This programs not registered as add-on.)
    (Note2: We have not yet SDK, the media is coming soon.)
    Best regards
    Gabor
    PS.: Sorry my terrible english!

    Gabor,
    the program needs to be registered with SBO, otherwise SBO cannot hand over the events (as far as I know). You probably just need to wait for your SDK ;(
    When you start, make sure that your first if- clause is
    If pVal.Before_Action = True
    otherwise you will get a lot of events twice (once before and once after event).
    Here is a quick sample of a handler I use.
    HTH Lutz Morrien
    Public Overrides Sub HANDLE_FORM_EVENTS(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean)
        Try
          If pVal.Before_Action = True Then
            Select Case pVal.EventType
              Case SAPbouiCOM.BoEventTypes.et_FORM_ACTIVATE
                'update display
                DisplayLabels()
            End Select
            'AFTER ACTION
          Else
            Select Case pVal.EventType
              Case SAPbouiCOM.BoEventTypes.et_ITEM_PRESSED
                Select Case pVal.ItemUID
                  Case "btnPRINT"
                    PrintLabels(True, False)
                  Case "btnPRNTS"
                    SBO_Application.Desktop.State = SAPbouiCOM.BoFormStateEnum.fs_Minimized
                    PrintLabels(False, False)
                    SBO_Application.Desktop.State = SAPbouiCOM.BoFormStateEnum.fs_Maximized
                  Case "btnEDIT"
                    EditMarkedLabel()
                  Case "btnDELETE"
                    DeleteMarkedLabel()
                  Case "chkALL"
                    SwitchMarkOnAllRows()
                  Case "btnPREVIEW"
                    SBO_Application.Desktop.State = SAPbouiCOM.BoFormStateEnum.fs_Minimized
                    PrintLabels(True, True)
                    SBO_Application.Desktop.State = SAPbouiCOM.BoFormStateEnum.fs_Maximized
                End Select
            End Select
          End If
        Catch excE As Exception
          SBO_Application.MessageBox(excE.ToString)
        End Try
      End Sub

  • How to catch browser close event excluding navigation events

    Hi,
    I tried using onBeforeUnload event and onUnload events.. but they are catching navigation events within the same site. Could you please let me know how I can catch browser close events without catching Navigation events?
    Thanks.

    Just set them to null when navigation takes place.
    Said that, you should be asking Javascript/DHTML related questions in a forum devoted to Javascript/DHTML. There are ones at webdeveloper.com and dynamicdrive.com. This has nothing to do with Java.

  • Catch AE close event

    Hi,
    I'm working on scripts for AE, and I am currently trying to find a way to catch an event when the user close the application (so I can execute some code before it closes).
    I saw some onClose() functions but I heard they don't work anymore with CS6...
    Thank you for your Time!
    Ekibyo

    Hi!
    Actually, you don't need to catch the close event.
    When After Effects closes, it checks this folder:
    Adobe After Effects (your version)/Support Files/Scripts/Shutdown
    and runs the scripts present in this folder.
    So if you paste your script in the Shutdown folder, it'll be launched on close event.
    If you want to launch scripts on Startup, you'll find a Startup folder as well...
    Cheers,
    François

  • Can I switch calendars (Ex. "night shift" to "day shift" cal) with a repeating event, but ONLY for that one event??  It asks "for all events or only this event" if i change the time.  But it changes ALL events when i try and switch calendars.  Any help??

    I have 2 calendars set up for my work schedule, a "night shift" and "day shift" calendar.  I've set up repeating events fro Fri/Sat/Sun 3-11pm "night shifts" and Mon/Tues 7am-3pm "day shifts".  But lets say for example that I swap shifts and instead of working nights on Saturday like I normally would, I am now working days.  I want to change that in my calendar.  When I go to change the event, if i change the TIME it asks if i want to change all event or ONLY this event.  no problem....just this single event.  but when i go to change the event from the "night shift" calendar to the "day shift" calendar, it changes ALL the repeating events, and not just that one single event.   can anyone help with this???  am i doing something wrong?  is there a way to do this or not with the new iCal program???  i used to do this and never had any problems.    Thank you!

    You need to follow iPhoto terms since we only know what you tell us
    what are you calling folders - in iPhoto folders can not hold photos - albums hold photos and folders hold albums or other folders
    The basic default view of photo is by event (iPhoto '08 and later)
    Exactly what you you trying to do?
    LN

  • My i phone 5s is open and close . i see only the of apple

    My i phone 5s is open and close . i see only the logo of apple

    Hi Imad101,
    Thanks for using Apple Support Communities.  If you're unable to get past the Apple logo on your iPhone 5s, this article may help:
    iOS: Unable to update or restore
    http://support.apple.com/kb/ht1808
    Cheers,
    - Ari

  • How do I add a recurring event to repeat on the fifth recurring day of the month, for example, an event that only happen on the fifth Sunday of the month for those months that have a fifth Sunday?

    How do I add a recurring event to repeat on the fifth recurring day of the month, for example, an event that only happen on the fifth Sunday of the month for those months that have a fifth Sunday?

    Create one on the first Tuesday, select repeat/monthly and take the option at the bottom.

  • How To Get The CLOSE Event In a JSP File?

    Hello everybody,
    Right now I am working in a JSP project which is about access log, when the users start , oprate, or close the system, the access log system works. I am in trouble in that when the users close the system, how can I get the close event?
    The JSP file contains the following fields :
    Close Window
    How to add code to get the CLOSE Event and submit to the service?
    And If I hit the "Close Button"(on the right-top of the window), how can I get the CLOSE event, too?
    Can anyone tell me?

    1. Add a hidden field:
    <input type="hidden" id="status" value="">2. modify <a href="index.jsp" onclick ="parent.window.close( );">Close Window</a> with <a href="index.jsp" onclick ="closefn();">Close Window</a>3. Add a javascript
    <script language="javascript">function closefn(){
    document.getElementById('status').value="close";
    document.form.action="";
    document.form.method="post";
    document.form.submit();
    parent.window.close( );
    }4. Now on the action page get the value of status by request.getParameter("status"); and log it.

  • Calendar - when I want to edit a monthly recurring event but only for one month I am no longer given the box to update only that date.

    Calenndar - when I want to edit a monthly recurring event but only for one month I am no longer given the box to update only that date month.  How do I do this with the new operating system?

    Adding to Alan's answer:
    One of the problems that comes with these tricks for variable-rate acquisition is being able to match up sample data with the time that it was sampled. 
    If you weren't using either of E-series board's counters, there is a nifty solution to this!  You'll be using 1 of the counters to generate the variable-rate sampling clock.  You can then use the 2nd counter to perform a buffered period measurement on the output of the 1st counter.  This gives you a hw-timed measurement of every sampling interval.  You would need to keep track of a cumulative sum of these periods to generate a hw-accurate timestamp value for each sample.
    Note:  the very first buffered period measurement is the time from starting the 2nd counter until the first active edge from the 1st.  For your app, you should ignore it.
    -Kevin P.

Maybe you are looking for

  • Need Report in which using PC/CC , planned order could be found out.

    Hi All, Is there any standard report to find a Plan report for 2009 using which one could see the orders planned for respective department and where we can book time. Any report ( if any) in which using profit center or cost center the planned orders

  • Java install on Ubuntu

    Hi all, I downloaded the latest j2se1.4 (test purposes). I have followed the install instructions, i have even added the following to my /etc/profile. export JAVA_HOME=/opt/j2sdk1.4.2_07 export CLASSPATH=. export PATH=$PATH:$JAVA_HOME/bin I am only a

  • Error in BW ( Operating system call SiPeekPendConn failed )

    Hi All, This is Ganesh, new to SAP BASIS. We are facing some errors in BW, where users cannot able to run BW reports from yesterday. Please find below system log details: Operating system call recv failed (error no. 10054) NiConnect Unsuccessful, Ret

  • In Web.xml  welcome file tag not works

    Hi All , I am developing simple web application using spring framework when i am try to add welcome file tag in web.xml with respective welcome page path but it not works. but when use jsp page without to having any property it works. what the proble

  • Bridge is transferring the camera system files from my SD card!

    When I use Bridge to transfer photos from my SD card to my computer (MacBook) it  transfers some of the camera system files!  How can I get it to trasfer only the jpegs and/or raw? I am using PSE 8 for mac.