diff options
author | Bill Nottingham <notting@redhat.com> | 2008-01-10 19:21:03 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2008-01-10 19:21:03 +0000 |
commit | 9765374882bc40bb532fe7d0ef70cb46fa4fcf3e (patch) | |
tree | e6db87694a618e46821ab2173d07889534002e5b | |
parent | b72f2038928b3834f22602e1cdee5939ca72568f (diff) | |
download | initscripts-9765374882bc40bb532fe7d0ef70cb46fa4fcf3e.tar initscripts-9765374882bc40bb532fe7d0ef70cb46fa4fcf3e.tar.gz initscripts-9765374882bc40bb532fe7d0ef70cb46fa4fcf3e.tar.bz2 initscripts-9765374882bc40bb532fe7d0ef70cb46fa4fcf3e.tar.xz initscripts-9765374882bc40bb532fe7d0ef70cb46fa4fcf3e.zip |
backport getkey race fixes from RHEL 5 (#313611, <mpoole@redhat.com>)
-rwxr-xr-x | rc.d/rc.sysinit | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/rc.d/rc.sysinit b/rc.d/rc.sysinit index 0e60ff63..8da2aedf 100755 --- a/rc.d/rc.sysinit +++ b/rc.d/rc.sysinit @@ -959,15 +959,24 @@ dmesg -s 131072 > /var/log/dmesg # create the crash indicator flag to warn on crashes, offer fsck with timeout touch /.autofsck &> /dev/null -kill -TERM `/sbin/pidof getkey` >/dev/null 2>&1 +if [ "$PROMPT" != no ]; then + while :; do + pid=$(/sbin/pidof getkey) + [ -n "$pid" -o -e /var/run/getkey_done ] && break + usleep 100000 + done + [ -n "$pid" ] && kill -TERM "$pid" >/dev/null 2>&1 +fi } & if strstr "$cmdline" confirm ; then touch /var/run/confirm fi if [ "$PROMPT" != "no" ]; then /sbin/getkey i && touch /var/run/confirm + touch /var/run/getkey_done fi wait +[ "$PROMPT" != no ] && rm -f /var/run/getkey_done if [ -x /sbin/redhat-support-check -a -f /var/lib/supportinfo ]; then /sbin/redhat-support-check || { |