Bug 17842

Summary: /sbin/getkey could hang system on startup
Product: [Retired] Red Hat Linux Reporter: Arenas Belon, Carlo Marcelo <carenas>
Component: initscriptsAssignee: Bill Nottingham <notting>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 6.2CC: rvokal
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: 2001-01-10 18:21:08 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
getkey patch for timeout parameter (taken from 5.49)
none
adding a PROMPT_DELAY option to initscript none

Description Arenas Belon, Carlo Marcelo 2000-09-26 00:47:37 UTC
on rc.sysinit there is a posible "race condition" between calling getkey
(for interactive startup) and killing getkey (before starting selected
runlevel scripts)

a snip of the rc.sysinit is shown below

{
# Clean up utmp/wtmp
>/var/run/utmp
touch /var/log/wtmp
chgrp utmp /var/run/utmp /var/log/wtmp
...
kill -TERM `/sbin/pidof getkey` >/dev/null 2>&1
}&
if [ "$PROMPT" != "no" ]; then
  /sbin/getkey i && touch /var/run/confirm
fi
wait

as you can see, if the code between the {} runs too fast, you could end
with an stalled "getkey" waiting forever for input (as i have experienced
on some Compaq Dual Processor, Hardware RAID servers like Proliant DL360
and DL380).

after testing with bash1 and bash2 scripts there seems to be at least a
needed 1 second delay before the kill is reached for getting a successfull
kill of getkey (running on different threads of the same script)

getkey from initscripts-5.49 has a timeout parameter that could be used to
avoid this "race condition", so a patch would be needed to upgrade getkey
and to use the timeout parameter on rc.sysinit

both patches are attached and a "proof of concept" is available from :

ftp://sajino.terra.com.pe/pub/linux/redhat/carenas/6.2/initscripts-5.00-3.i386.rpm

thanks goes to Sandro Jurado from Compaq for pushing on the right direction
and away from a problem on their Compaq Smart Array Adapter ;)

Comment 1 Arenas Belon, Carlo Marcelo 2000-09-26 00:48:29 UTC
Created attachment 3563 [details]
getkey patch for timeout parameter (taken from 5.49)

Comment 2 Arenas Belon, Carlo Marcelo 2000-09-26 00:50:06 UTC
Created attachment 3564 [details]
adding a PROMPT_DELAY option to initscript

Comment 3 Arenas Belon, Carlo Marcelo 2000-09-26 00:52:04 UTC
*** Bug 17817 has been marked as a duplicate of this bug. ***

Comment 4 Arenas Belon, Carlo Marcelo 2001-01-10 18:21:03 UTC
changed to private as there is a reference to a private bug

Comment 5 Bill Nottingham 2001-01-30 00:46:47 UTC
sleep added as of initscripts-5.60-1.