Red Hat Bugzilla – Bug 975063
Anaconda pre script stdin file descriptor set to /tmp/ks-script-xxxxxx.log instead of /dev/tty1
Last modified: 2014-10-07 19:33:11 EDT
Description of problem:
When running Anaconda from the Fedora19-netinstall disk with a kickstart file selected, our pre script runs with a bad file descriptor for stdin; /tmp/ks-script-xxxxxx.log (changes each time).
This happens each and every time we run our kickstart with F19-Beta
Steps to Reproduce:
1. Using F19-Beta netinstall disk, try to install with a kickstart file by adding ks=(kickstart cfg here) to the boot line
2. This fails as soon as step-1 of Anaconda starts, with the pre script section.
Enter username: /tmp/ks-script-VsOCR, line 14: read: read error: 0: bad file descriptor
Enter username: (username)
I realize the easy way to fix this is redirecting stdin for read to the terminal, and that's our solution at the moment, but this is a strange bug.
The pre script in our kickstart (the error rears its ugly head on the line `read -ep "Username: " USERNAME`:
%pre --interpreter /bin/bash
# Checks the file exists and has some data in it
[ -f "$1" ] && [ $(wc -c <"$1") -gt 50 ]
echo "You must authenticate as an employee in order to install this host's keytab file."
read -ep "Username: " USERNAME
# Work whether or not we have kinit on this boot disk
if ! which kinit &>/dev/null
# Connecting to a host will give us a kerberos ticket
# that we can use to connect to rsync@update.
# Alternatively we could do that locally with kinit,
# but that requires building that into the boot image.
ssh -qnKl "$USERNAME" -o StrictHostKeyChecking=no machine1 "ssh -qnK -o StrictHostKeyChecking=no rsync@machine2 cat 'keytabs/$(hostname)'" >/tmp/krb5.keytab
# Hey we have kinit
# Get a temporary kerberos ticket as this user
kinit -FP -r1h "$USERNAME"
if ! looks_good "$KRB5CCNAME"
# Use that ticket to download this host's keytab
scp -o GSSAPIAuthentication=yes -o StrictHostKeyChecking=no "email@example.com:~/keytabs/$(hostname)" /tmp/krb5.keytab
# Shouldn't get to this point
echo "Failed, please try again."
# Check that the keytab file exists and has content
if ! looks_good /tmp/krb5.keytab
echo "Keytab file not retrieved correctly. Halting."
Fixed in commit a8046ae on master only.