Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: acpilid works in single user but not in multiuser



On Fri, Jul 3, 2009 at 10:42 AM, Paul Goyette<paul%whooppee.com@localhost> 
wrote:
> Hmmm, looking closer at /etc/powerd/scripts/lid_switch it appears that
> powerd by default does pretty much nothing on a lid-switch event!
>
> There's some calls to /usr/sbin/apm but they're commented out, and they're
> also conditionalized on whether apmd is running.
>
> You might want to add a call to logger(1) to display the event on your
> console...
>
> On Fri, 3 Jul 2009, Paul Goyette wrote:
>
>> I'm assuming that you have 'powerd=YES' in your /etc/rc.conf file?
>>
>> sysmon_pswitch_event() checks to see if powerd process is running;  if
>> yes, then the lid event is delivered to powerd.  But if powerd is not
>> running (as would be expected in single-user mode), sysmon_pswitch_event
>> does it's own printf()s.
>>
>> I don't see any obvious error paths in the code that delivers the event to
>> powerd (sysmon_power_daemon_task() in particular), but it might be useful to
>> do throw in some debugging printf()s...
>>
>>
>> On Fri, 3 Jul 2009, matthew sporleder wrote:
>>
>>> So for a while I've thought the lid switch was broken on my eeepc, but
>>> then today I had a disk problem and ended up in single user mode.  To
>>> my surprise I found out that my lid switch was working again and
>>> reporting to the console!
>>>
>>> When I fsck-ed and rebooted I ended up with a non working lid switch
>>> again until I did a "shutdown now".  After that the console is back to
>>> printing out those re-assuring messages from acpilid.  I'm currently
>>> running 5.99.11 from a little while ago.  Any ideas?
>>>
>>> Matt
>>>

Thanks, it was powerd eating the message.  I've added the following
(including handy screen blanking logic):

--- ./lid_switch.orig   2009-07-03 12:04:26.000000000 -0400
+++ ./lid_switch        2009-07-03 12:13:17.000000000 -0400
@@ -15,9 +15,18 @@
        #else
        #       /usr/sbin/apm -d -S
        #fi
+       logger -p warning "${0}: ($1) lid closed" >&1
+       if [ -x /usr/pkg/sbin/vbetool ]; then
+               /usr/pkg/sbin/vbetool dpms suspend
+       fi
        exit 0
        ;;
 released)
+       logger -p warning "${0}: ($1) lid opened" >&1
+       if [ -x /usr/pkg/sbin/vbetool ]; then
+               /usr/pkg/sbin/vbetool dpms on
+       fi
+       exit 0
        ;;
 *)
        logger -p warning "${0}: unsupported event ${2} on device ${1}" >&1


Home | Main Index | Thread Index | Old Index