Bug 17817 - getkey could hang system on startup
getkey could hang system on startup
Status: CLOSED DUPLICATE of bug 17842
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Bill Nottingham
Depends On:
  Show dependency treegraph
Reported: 2000-09-25 02:58 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:
Last Closed: 2000-09-25 20:52:08 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Arenas Belon, Carlo Marcelo 2000-09-25 02:58:41 EDT
on rc.sysinit there is a posible "race condition" between calling getkey
(for interactive startup) and killing getkey (before starting selected
runlevel scripts)

# Clean up utmp/wtmp
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

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 systems and the simpler script
from RH6.2)

to be fair, i've been unable to reproduce the same "hung" on 7.0final but
there is a theorical posibility that if given enough resources this could
happen (there seems to be a need for about 1 second before the kill is
reached for getting a successfull kill of getkey)

my solution was to patch rc.sysinit so getkey is called with a "timeout"
parameter (seems like someone on RH tought it could happen before and added
the timeout parameter but no fix on the rc.sysinit script)

if [ "$PROMPT" != "no" ]; then
  /sbin/getkey -3 i && touch /var/run/confirm

RH6.2's getkey doesn't have the "timeout" parameter so a backport should be
released with the modified rc.sysinit to fix this problem.
Comment 1 Arenas Belon, Carlo Marcelo 2000-09-25 20:52:06 EDT
solved for RH 6.2, could be used on 7.0 and others

*** This bug has been marked as a duplicate of 17842 ***

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