Bug 57955

Summary: apmscript messes up terminal beep
Product: [Retired] Red Hat Linux Reporter: eric_backus
Component: apmdAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact: Aaron Brown <abrown>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-01-24 22:52:30 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to fix problem none

Description eric_backus 2002-01-03 09:50:41 UTC
Description of Problem:

1. When running in a Linux terminal, not in X, resuming from suspend 
always messes up the terminal beep (the beep is silent when it sounded 
fine before the suspend).  This caused by a problem in 
/etc/sysconfig/apm-scripts/apmscript.  The problem is that the 
/etc/sysconfig/apmd config file sets TERMINALBEEP to "no" (which is 
correct), but apmscript checks for whether the variable is non-null.  As 
a result, apmscript tries to call setterm -blength $BEEPLENGTH, bug 
BEEPLENGTH is not defined anywhere and this causes the terminal beep to 
go away.

I believe the problem is apmscript and not the apmd config file, because 
there are several other variables in the config file that also use "yes" 
and "no" as the possible values.

2.  apmscript calls apmcontinue, but it doesn't pass all the original 
arguments that apmscript had.  This is a problem for resume events - the 
apmcontinue script gets an argument of "resume", but doesn't get the 
second argument "suspend" or "standby", so apmcontinue can't tell which 
kind of resume this is.

This actually matters on my laptop, which needs the keyboard repeat rate 
restored after resuming from suspend but not from standby.  (The need to 
restore the repeat rate is probably a BIOS bug.)

I'm attaching a simple patch which fixes both these problems.


Version-Release number of selected component (if applicable):
apmd-3.0final-34

How Reproducible:
Always

Steps to Reproduce:
1. Suspend the system
2. Resume the system
3. Go to Linux console (not X window) and type something that should 
beep, like a backspace or control-G.  Notice it doesn't beep.
4. Create an apmcontinue script that does different things for resume 
from suspend versus resume from standby.
5. Try both suspend and standby, and notice that the script can't tell 
the difference between them.

Actual Results:


Expected Results:


Additional Information:

Comment 1 eric_backus 2002-01-03 09:59:47 UTC
Created attachment 41691 [details]
Patch to fix problem

Comment 2 Bernhard Rosenkraenzer 2002-02-26 18:00:28 UTC
 Fixed in 3.0.2-6