HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Hardware Newsgroups > Laptops > Thinkpads

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 04-30-2007, 02:21 PM
Dario Ernst
Guest
 
Posts: n/a
Default vlock / laplock and suspend to ram problem

Hello World,

i've got a strange problem featuring vlock (or more precise cehtehs
laplock.sh) and my sleep script (basically a echo mem >
/sys/power/state). The thing is, when sleeping you would want to lock
the screen. But as soon as my locking script runs echo mem >
/sys/power/state does not work anymore. In most cases it leaves a
"zombie" echo (state S+ but does not do anything) and sys/power/state
will tell you that the "device or resource is busy".

Normally both laplock and suspend work - just as soon as laplock is
active the echo does not work anymore.

After returning from Laplock and killall -9'ing that echo the laptop
goes to suspend. The problem here is that it wont wake up again
properly. Sysrq works, but the screen wont show anything, the backlight
wont come to live again.


laplock:
#!/bin/sh
test -f /tmp/laplocked && exit
touch /tmp/laplocked
renice -20 $$
(
logger -t laplock -p auth.info 'locked'
sysreq=$(cat /proc/sys/kernel/sysrq)
echo 0 >/proc/sys/kernel/sysrq
fguser=$(find /dev/tty$(fgconsole) -printf "%u")
openvt -sw -- su $fguser -c 'cat /etc/issue; vlock -a'
rm /tmp/laplocked
echo $sysreq > /proc/sys/kernel/sysrq
logger -t laplock -p auth.info 'unlocked'
deallocvt
) &
sync

susp:
sudo ifconfig eth0 down
rmmod uhci_hcd
rmmod ehci_hcd
rmmod hci_usb
rmmod ahci
echo SLEEPING
chmod a+w /sys/power/state
echo mem > /sys/power/state
chmod a-w /sys/power/state
modprobe uhci_hcd
modprobe ehci_hcd
modprobe ahci
echo WOKE UP
sudo ifconfig eth0 up



those are called via /etc/acpid/sleep.sh. i tried the following:
laplock& susp
susp; laplock
susp; laplock&
(laplock&sleep 2); susp


Thanks in advance!
- Dario
Reply With Quote
Sponsored Links
  #2  
Old 04-30-2007, 04:55 PM
Ian Collier
Guest
 
Posts: n/a
Default Re: vlock / laplock and suspend to ram problem

Dario Ernst <usenet@nebuk.de> told comp.sys.laptops.thinkpad:
>i've got a strange problem featuring vlock (or more precise cehtehs
>laplock.sh) and my sleep script (basically a echo mem >
>/sys/power/state). The thing is, when sleeping you would want to lock
>the screen. But as soon as my locking script runs echo mem >
>/sys/power/state does not work anymore. In most cases it leaves a
>"zombie" echo (state S+ but does not do anything) and sys/power/state
>will tell you that the "device or resource is busy".


This is a complete guess on my part, since I don't use "laplock" (and I
use Fedora's pm-suspend to suspend my ThinkPad which does a whole bunch
of stuff besides messing with /sys/power/state).

Anyway. I notice your laplock script uses "vlock -a" to lock
the console. One of the things this command does is prevent the
kernel from being able to switch VTs. I wonder if that's what is
stopping the suspend from working (although to be honest I didn't
think /sys/power/state handled VT switches by itself). One way to
find this out is to remove the "-a" argument from the script and see
if that starts it working. Everything else that vlock does seems
completely innocent to me.

It seems to me it doesn't matter whether the console is locked while
the machine is sleeping - only when it wakes up from sleep - so I might
suggest doing the vlock just after the "echo mem > /sys/power/state" so
that it locks as soon as you wake the machine up.
--
---- Ian Collier : imc@comlab.ox.ac.uk : WWW page below
------ http://users.comlab.ox.ac.uk/ian.collier/imc.shtml
Reply With Quote
  #3  
Old 04-30-2007, 05:16 PM
Dario Ernst
Guest
 
Posts: n/a
Default Re: vlock / laplock and suspend to ram problem

Hi Ian,

Thanks for your answer ;P

On 2007-04-30, Ian Collier <imc@comlab.ox.ac.uk> wrote:
> It seems to me it doesn't matter whether the console is locked while
> the machine is sleeping - only when it wakes up from sleep - so I might
> suggest doing the vlock just after the "echo mem > /sys/power/state" so
> that it locks as soon as you wake the machine up.


I tried that at first, the problem was - as i wrote - that the screen
would blank and not come to live again. I had to reboot the box using
Sysrq.
However now that you wrote i tried again: source `which laplock` after
the echo line in susp.
Works like a charm - don't ask me why. Simply invoking the script blanks
the screen, but source works.

Now - what the heck?

Thanks for your tipps!

- Dario
Reply With Quote
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT. The time now is 11:36 PM.


Powered by vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger