Bug 17842 - /sbin/getkey could hang system on startup
/sbin/getkey could hang system on startup
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
6.2
All Linux
medium Severity high
: ---
: ---
Assigned To: Bill Nottingham
:
: 17817 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-09-25 20:47 EDT by Arenas Belon, Carlo Marcelo
Modified: 2014-03-16 22:16 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-10 13:21:08 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
getkey patch for timeout parameter (taken from 5.49) (1.06 KB, patch)
2000-09-25 20:48 EDT, Arenas Belon, Carlo Marcelo
no flags Details | Diff
adding a PROMPT_DELAY option to initscript (768 bytes, patch)
2000-09-25 20:50 EDT, Arenas Belon, Carlo Marcelo
no flags Details | Diff

  None (edit)
Description Arenas Belon, Carlo Marcelo 2000-09-25 20:47:37 EDT
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-25 20:48:29 EDT
Created attachment 3563 [details]
getkey patch for timeout parameter (taken from 5.49)
Comment 2 Arenas Belon, Carlo Marcelo 2000-09-25 20:50:06 EDT
Created attachment 3564 [details]
adding a PROMPT_DELAY option to initscript
Comment 3 Arenas Belon, Carlo Marcelo 2000-09-25 20:52:04 EDT
*** Bug 17817 has been marked as a duplicate of this bug. ***
Comment 4 Arenas Belon, Carlo Marcelo 2001-01-10 13:21:03 EST
changed to private as there is a reference to a private bug
Comment 5 Bill Nottingham 2001-01-29 19:46:47 EST
sleep added as of initscripts-5.60-1.

Note You need to log in before you can comment on or make changes to this bug.