Bug 17842 - /sbin/getkey could hang system on startup
Summary: /sbin/getkey could hang system on startup
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 6.2
Hardware: All
OS: Linux
medium
high
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact:
URL:
Whiteboard:
: 17817 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-09-26 00:47 UTC by Arenas Belon, Carlo Marcelo
Modified: 2014-03-17 02:16 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2001-01-10 18:21:08 UTC
Embargoed:


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

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.


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