[ltp] Installed & configured hibernate package. Fn+F4 not working.

Brian Wood linux-thinkpad@linux-thinkpad.org
Tue, 29 Jul 2008 23:30:07 -0700


This is a multi-part message in MIME format.
--------------050709030802080909000807
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

I've got a Thinkpad T40p and I'm using Ubuntu 8.04 (Hardy Heron). I've 
installed the hibernate package and done a little customization. 
Everything works if I invoke sleep using sudo from the command line. If 
I use my Fn + F4 key combo, a couple of things don't work.  I'd be 
grateful for any thoughts on what might be wrong.  Thanks!

Customizations to /etc/hibernate/common.conf:

# disable Gnome screen lock for testing purposes
# LockGnomeScreenSaver yes

### misclaunch
OnSuspend 70 /etc/pm/sleep.d/kill-timidity.sh
OnSuspend 99 echo "Good night!"

OnResume 70 echo "Starting timidity" && /etc/init.d/timidity\ start
OnResume 99 echo "Good morning!"

If I invoke suspend from a terminal

/usr/sbin/hibernate --config-file=/etc/hibernate/ram.conf

it works as it should:

1. My script kills timidity.
2. Laptop suspends.
3. When I resume the Gnome Screen Lock does not appear.
4. Timidity restarts.

hibernate.log resume entries:

hibernate: [99] Executing MiscLaunchAuxFunc4 ... 
Executing echo "Good morning!"...
Good morning!
hibernate: [95] Executing XStatusResumeBegin ... 
hibernate: [90] Executing XStatusProgress ... 
hibernate: [90] Executing ModulesLoad ... 
hibernate: [89] Executing RestoreKernelModprobe ... 
hibernate: [85] Executing XHacksResumeHook2 ... 
hibernate: [80] Executing XStatusProgress ... 
hibernate: [70] Executing XStatusProgress ... 
hibernate: [70] Executing MiscLaunchAuxFunc3 ... 
Executing echo "Starting timidity" && /etc/init.d/timidity start...
Starting timidity
 * Starting TiMidity++ ALSA midi emulation...       [ OK ]
hibernate: [70] Executing ClockRestore ... 
hibernate: [60] Executing XStatusProgress ... 
hibernate: [59] Executing RemountXFSBootRW ... 
hibernate: [50] Executing XStatusProgress ... 
hibernate: [40] Executing XStatusProgress ... 
hibernate: [30] Executing XStatusProgress ... 
hibernate: [20] Executing XStatusProgress ... 
hibernate: [15] Executing XStatusProgress ... 
hibernate: [12] Executing IbmAcpiEndResume ... 
hibernate: [11] Executing XHacksResumeHook1 ... 
hibernate: [05] Executing XStatusProgressKill ... 
hibernate: [01] Executing XStatusReportErrors ... 
hibernate: [01] Executing NoteLastResume ... 
hibernate: [01] Executing LockFilePut ... 
Resumed at Sun Jul 27 21:25:11 PDT 2008

In order to get my Thinkpad's Fn + F4 suspend key combo working I edited
/etc/acpi/events/ibm-sleepbtn as follows:

# /etc/acpi/events/ibmsleepbtn
# Called when the user presses the sleep button

event=ibm/hotkey HKEY 00000080 00001004

#orignial action line
#action=/etc/acpi/sleepbtn.sh

#sleep.sh contains: /usr/sbin/hibernate --config-file=/etc/hibernate/ram.conf
action=/etc/acpi/sleep.sh force

After making that edit, I believe you have to do this:

sudo /etc/init.d/acpid restart

If I suspend using my Thinkpad's Fn + F4 suspend key combo:

1. My script kills timidity.
2. Laptop suspends.
3. When I resume the Gnome Screen Lock *DOES appear*
4. Timidity *FAILS to restart*.

hibernate.log resume entries:

hibernate: [99] Executing MiscLaunchAuxFunc4 ... 
Executing echo "Good morning!"...
Good morning!
hibernate: [95] Executing XStatusResumeBegin ... 
hibernate: [90] Executing XStatusProgress ... 
hibernate: [90] Executing ModulesLoad ... 
hibernate: [89] Executing RestoreKernelModprobe ... 
hibernate: [85] Executing XHacksResumeHook2 ... 
hibernate: [80] Executing XStatusProgress ... 
hibernate: [70] Executing XStatusProgress ... 
hibernate: [70] Executing MiscLaunchAuxFunc3 ... 
Executing echo "Starting timidity" && /etc/init.d/timidity start...
Starting timidity
 * Starting TiMidity++ ALSA midi emulation...      [ fail ]
hibernate: [70] Executing ClockRestore ... 
hibernate: [60] Executing XStatusProgress ... 
hibernate: [59] Executing RemountXFSBootRW ... 
hibernate: [50] Executing XStatusProgress ... 
hibernate: [40] Executing XStatusProgress ... 
hibernate: [30] Executing XStatusProgress ... 
hibernate: [20] Executing XStatusProgress ... 
hibernate: [15] Executing XStatusProgress ... 
hibernate: [12] Executing IbmAcpiEndResume ... 
hibernate: [11] Executing XHacksResumeHook1 ... 
hibernate: [05] Executing XStatusProgressKill ... 
hibernate: [01] Executing XStatusReportErrors ... 
hibernate: [01] Executing NoteLastResume ... 
hibernate: [01] Executing LockFilePut ... 
Resumed at Sun Jul 27 22:35:34 PDT 2008


I'm wondering what I need to do to get Fn + F4 to work the same as 
running the command via sudo command from a terminal. Seems like this 
might be a permissions problem?

kill-timidity.sh is executable by all:

Code:

-rwxr-xr-x 1 root root 164 2008-07-27 18:30 kill-timidity.sh

and I don't know what to make of the Gnome Screen Lock thing...

Thanks for any thoughts.

--------------050709030802080909000807
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
I've got a Thinkpad T40p and I'm using Ubuntu 8.04 (Hardy Heron). I've
installed the hibernate package and done a little customization.
Everything works if I invoke sleep using sudo from the command line. If
I use my Fn + F4 key combo, a couple of things don't work.&nbsp; I'd be
grateful for any thoughts on what might be wrong.&nbsp; Thanks!<br>
<br>
Customizations to /etc/hibernate/common.conf:<br>
<br>
<div style="margin: 5px 20px 20px;">
<pre class="alt2" dir="ltr"
 style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 50px; text-align: left;"># disable Gnome screen lock for testing purposes
# LockGnomeScreenSaver yes</pre>
</div>
<div style="margin: 5px 20px 20px;">
<pre class="alt2" dir="ltr"
 style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 114px; text-align: left;">### misclaunch
OnSuspend 70 /etc/pm/sleep.d/kill-timidity.sh
OnSuspend 99 echo "Good night!"

OnResume 70 echo "Starting timidity" &amp;&amp; /etc/init.d/timidity\ start
OnResume 99 echo "Good morning!"</pre>
</div>
If I invoke suspend from a terminal <br>
<br>
<div style="margin: 5px 20px 20px;">
<pre class="alt2" dir="ltr"
 style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left;">/usr/sbin/hibernate --config-file=/etc/hibernate/ram.conf</pre>
</div>
it works as it should: <br>
<br>
1. My script kills timidity. <br>
2. Laptop suspends. <br>
3. When I resume the Gnome Screen Lock does not appear. <br>
4. Timidity restarts.<br>
<br>
hibernate.log resume entries:<br>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;"><br>
</div>
<pre class="alt2" dir="ltr"
 style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 482px; text-align: left;">hibernate: [99] Executing MiscLaunchAuxFunc4 ... 
Executing echo "Good morning!"...
Good morning!
hibernate: [95] Executing XStatusResumeBegin ... 
hibernate: [90] Executing XStatusProgress ... 
hibernate: [90] Executing ModulesLoad ... 
hibernate: [89] Executing RestoreKernelModprobe ... 
hibernate: [85] Executing XHacksResumeHook2 ... 
hibernate: [80] Executing XStatusProgress ... 
hibernate: [70] Executing XStatusProgress ... 
hibernate: [70] Executing MiscLaunchAuxFunc3 ... 
Executing echo "Starting timidity" &amp;&amp; /etc/init.d/timidity start...
Starting timidity
 * Starting TiMidity++ ALSA midi emulation...       [ OK ]
hibernate: [70] Executing ClockRestore ... 
hibernate: [60] Executing XStatusProgress ... 
hibernate: [59] Executing RemountXFSBootRW ... 
hibernate: [50] Executing XStatusProgress ... 
hibernate: [40] Executing XStatusProgress ... 
hibernate: [30] Executing XStatusProgress ... 
hibernate: [20] Executing XStatusProgress ... 
hibernate: [15] Executing XStatusProgress ... 
hibernate: [12] Executing IbmAcpiEndResume ... 
hibernate: [11] Executing XHacksResumeHook1 ... 
hibernate: [05] Executing XStatusProgressKill ... 
hibernate: [01] Executing XStatusReportErrors ... 
hibernate: [01] Executing NoteLastResume ... 
hibernate: [01] Executing LockFilePut ... 
Resumed at Sun Jul 27 21:25:11 PDT 2008</pre>
</div>
In order to get my Thinkpad's Fn + F4 suspend key combo working I
edited <br>
/etc/acpi/events/ibm-sleepbtn as follows:<br>
<br>
<div style="margin: 5px 20px 20px;">
<pre class="alt2" dir="ltr"
 style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 178px; text-align: left;"># /etc/acpi/events/ibmsleepbtn
# Called when the user presses the sleep button

event=ibm/hotkey HKEY 00000080 00001004

#orignial action line
#action=/etc/acpi/sleepbtn.sh

#sleep.sh contains: /usr/sbin/hibernate --config-file=/etc/hibernate/ram.conf
action=/etc/acpi/sleep.sh force</pre>
</div>
After making that edit, I believe you have to do this:<br>
<br>
<div style="margin: 5px 20px 20px;">
<pre class="alt2" dir="ltr"
 style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left;">sudo /etc/init.d/acpid restart</pre>
</div>
If I suspend using my Thinkpad's Fn + F4 suspend key combo:<br>
<br>
1. My script kills timidity. <br>
2. Laptop suspends. <br>
3. When I resume the Gnome Screen Lock <b>DOES appear</b> <br>
4. Timidity <b>FAILS to restart</b>.<br>
<br>
hibernate.log resume entries:<br>
<br>
<div style="margin: 5px 20px 20px;">
<pre class="alt2" dir="ltr"
 style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 482px; text-align: left;">hibernate: [99] Executing MiscLaunchAuxFunc4 ... 
Executing echo "Good morning!"...
Good morning!
hibernate: [95] Executing XStatusResumeBegin ... 
hibernate: [90] Executing XStatusProgress ... 
hibernate: [90] Executing ModulesLoad ... 
hibernate: [89] Executing RestoreKernelModprobe ... 
hibernate: [85] Executing XHacksResumeHook2 ... 
hibernate: [80] Executing XStatusProgress ... 
hibernate: [70] Executing XStatusProgress ... 
hibernate: [70] Executing MiscLaunchAuxFunc3 ... 
Executing echo "Starting timidity" &amp;&amp; /etc/init.d/timidity start...
Starting timidity
 * Starting TiMidity++ ALSA midi emulation...      [ fail ]
hibernate: [70] Executing ClockRestore ... 
hibernate: [60] Executing XStatusProgress ... 
hibernate: [59] Executing RemountXFSBootRW ... 
hibernate: [50] Executing XStatusProgress ... 
hibernate: [40] Executing XStatusProgress ... 
hibernate: [30] Executing XStatusProgress ... 
hibernate: [20] Executing XStatusProgress ... 
hibernate: [15] Executing XStatusProgress ... 
hibernate: [12] Executing IbmAcpiEndResume ... 
hibernate: [11] Executing XHacksResumeHook1 ... 
hibernate: [05] Executing XStatusProgressKill ... 
hibernate: [01] Executing XStatusReportErrors ... 
hibernate: [01] Executing NoteLastResume ... 
hibernate: [01] Executing LockFilePut ... 
Resumed at Sun Jul 27 22:35:34 PDT 2008</pre>
</div>
<br>
I'm wondering what I need to do to get Fn + F4 to work the same as
running the command via sudo command from a terminal. Seems like this
might be a permissions problem? <br>
<br>
kill-timidity.sh is executable by all:<br>
<br>
<div style="margin: 5px 20px 20px;">
<div class="smallfont" style="margin-bottom: 2px;">Code:</div>
<pre class="alt2" dir="ltr"
 style="border: 1px inset ; margin: 0px; padding: 6px; overflow: auto; width: 640px; height: 34px; text-align: left;">-rwxr-xr-x 1 root root 164 2008-07-27 18:30 kill-timidity.sh</pre>
</div>
and I don't know what to make of the Gnome Screen Lock thing...<br>
<br>
Thanks for any thoughts.
</body>
</html>

--------------050709030802080909000807--