apmd closes/crashes on lid close

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

apmd closes/crashes on lid close

Robert Connolly-6
Hello.

I am running apmd without arguments from rc.conf. I am also running lid
close suspend from sysctl.conf. When I close the lid, and open it again,
apmd is gone from 'ps auxw'.

In /etc/apm/suspend I am hitting xidle with a signal 30. xidle is sparking
xlock with a -startCmd apm -C, and an -endCmd apm -H.

/var/log/messages and /var/log/daemon is not logging anything unusual from
apmd.

Reply | Threaded
Open this post in threaded view
|

Re: apmd closes/crashes on lid close

Philip Guenther-2
On Sat, Jun 2, 2012 at 11:38 PM, Robert Connolly
<[hidden email]> wrote:
> I am running apmd without arguments from rc.conf. I am also running lid
> close suspend from sysctl.conf. When I close the lid, and open it again,
> apmd is gone from 'ps auxw'.

ktrace?
run it under gdb (passing it the -d option to not go into the
background) and see what signal kills it and where?


Philip Guenther

Reply | Threaded
Open this post in threaded view
|

Re: apmd closes/crashes on lid close

Jan Stary
In reply to this post by Robert Connolly-6
On Jun 02 23:38:14, Robert Connolly wrote:
> Hello.
>
> I am running apmd without arguments from rc.conf. I am also running lid
> close suspend from sysctl.conf. When I close the lid, and open it again,
> apmd is gone from 'ps auxw'.
>
> In /etc/apm/suspend I am hitting xidle with a signal 30.

Why are you hooking your suspend action to xidle?
What do you want to happen on a lid close, beside
the machine suspending, and why?

> xidle is sparking
> xlock with a -startCmd apm -C, and an -endCmd apm -H.
>
> /var/log/messages and /var/log/daemon is not logging anything unusual from
> apmd.

Reply | Threaded
Open this post in threaded view
|

Re: apmd closes/crashes on lid close

Dan Harnett-3
In reply to this post by Philip Guenther-2
On Sun, Jun 03, 2012 at 12:41:31AM -0700, Philip Guenther wrote:
> On Sat, Jun 2, 2012 at 11:38 PM, Robert Connolly
> <[hidden email]> wrote:
> > I am running apmd without arguments from rc.conf. I am also running lid
> > close suspend from sysctl.conf. When I close the lid, and open it again,
> > apmd is gone from 'ps auxw'.
>
> ktrace?
> run it under gdb (passing it the -d option to not go into the
> background) and see what signal kills it and where?


I'm pretty sure I ran into this same issue a while ago.  I tried to use
/etc/apm/{powerup,powerdown} to switch between 'apm -C' and 'apm -A'
when undocking/docking my laptop.  apmd didn't like being poked by apm
from those files.  Just use apm in one of the related /etc/apm files to
reproduce.

  [danh@t obj] $ cat /etc/apm/resume
  apm -A

  [danh@t obj] $ sudo gdb apmd
  (gdb) set args '-d'
  (gdb) run
  Starting program: /usr/obj/usr.sbin/apmd/apmd '-d'
  [New process 12159]

[... enter suspend, then resume here ...]

  Terminated

  Program received signal SIGPIPE, Broken pipe.
  0x000000020a543c6a in sendto () from /usr/lib/libc.so.64.1
  (gdb) bt
  #0  0x000000020a543c6a in sendto () from /usr/lib/libc.so.64.1
  #1  0x00000000004020e9 in handle_client (sock_fd=Variable "sock_fd" is not available.
  ) at /usr/src/usr.sbin/apmd/apmd.c:469
  #2  0x00000000004027cd in main (argc=Variable "argc" is not available.
  ) at /usr/src/usr.sbin/apmd/apmd.c:728

Reply | Threaded
Open this post in threaded view
|

Re: apmd closes/crashes on lid close

Stuart Henderson
In reply to this post by Jan Stary
On 2012-06-03, Jan Stary <[hidden email]> wrote:

> On Jun 02 23:38:14, Robert Connolly wrote:
>> Hello.
>>
>> I am running apmd without arguments from rc.conf. I am also running lid
>> close suspend from sysctl.conf. When I close the lid, and open it again,
>> apmd is gone from 'ps auxw'.
>>
>> In /etc/apm/suspend I am hitting xidle with a signal 30.
>
> Why are you hooking your suspend action to xidle?
> What do you want to happen on a lid close, beside
> the machine suspending, and why?
>
>> xidle is sparking
>> xlock with a -startCmd apm -C, and an -endCmd apm -H.
>>
>> /var/log/messages and /var/log/daemon is not logging anything unusual from
>> apmd.
>
>

So you have to enter a password when the laptop comes back from suspend.

Reply | Threaded
Open this post in threaded view
|

Re: apmd closes/crashes on lid close

Robert Connolly-6
In reply to this post by Robert Connolly-6
Sometimes apmd crashes from a system suspend, and sometimes it does not.

Sometimes xidle runs xlock, and sometimes it does not.

Sometimes xlock asks for a password, and sometimes it does not.

Can anyone tell me whether they have all of these working consistently and
reliably?

They were not working for me yesterday. This morning it all worked
perfectly. Hours later, none of it worked.

Reply | Threaded
Open this post in threaded view
|

Re: apmd closes/crashes on lid close

Robert Connolly-6
"xset dpms 5 10 15" isn't doing anything either, nor "xset s 4".

On Sun, Jun 3, 2012 at 11:40 PM, Robert Connolly <
[hidden email]> wrote:

> Sometimes apmd crashes from a system suspend, and sometimes it does not.
>
> Sometimes xidle runs xlock, and sometimes it does not.
>
> Sometimes xlock asks for a password, and sometimes it does not.
>
> Can anyone tell me whether they have all of these working consistently and
> reliably?
>
> They were not working for me yesterday. This morning it all worked
> perfectly. Hours later, none of it worked.

Reply | Threaded
Open this post in threaded view
|

Re: apmd closes/crashes on lid close

Peter Laufenberg
dump "xset -q" and "wsconsctl -a", compare working/non-working states, check for possible race condition?

-- p

>"xset dpms 5 10 15" isn't doing anything either, nor "xset s 4".
>
>On Sun, Jun 3, 2012 at 11:40 PM, Robert Connolly <
>[hidden email]> wrote:
>
>> Sometimes apmd crashes from a system suspend, and sometimes it does not.
>>
>> Sometimes xidle runs xlock, and sometimes it does not.
>>
>> Sometimes xlock asks for a password, and sometimes it does not.
>>
>> Can anyone tell me whether they have all of these working consistently and
>> reliably?
>>
>> They were not working for me yesterday. This morning it all worked
>> perfectly. Hours later, none of it worked.

Reply | Threaded
Open this post in threaded view
|

Re: apmd closes/crashes on lid close

Stuart Henderson
In reply to this post by Robert Connolly-6
On 2012-06-04, Robert Connolly <[hidden email]> wrote:

> Sometimes apmd crashes from a system suspend, and sometimes it does not.
>
> Sometimes xidle runs xlock, and sometimes it does not.
>
> Sometimes xlock asks for a password, and sometimes it does not.
>
> Can anyone tell me whether they have all of these working consistently and
> reliably?
>
> They were not working for me yesterday. This morning it all worked
> perfectly. Hours later, none of it worked.
>
>

I have these working consistently, but I don't call apm at suspend
time as you were doing with your xlock command line.

(note that xidle does not lock the screen if the screensaver is
disabled, some video players etc do this, however it is consistent).