LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 07-08-2009, 06:19 AM   #1
adrianmarsh
LQ Newbie
 
Registered: Aug 2007
Posts: 4

Rep: Reputation: 0
Handling Kickstart post-install script GUI


Hi,

I'm experimenting with Kickstart/Centos5.3

Basic question: How can you handle interactive questions from within a kickstart environment, with a graphical installer?


All of my scripts work fine under a text-only install, but when (Anaconda?) is running a GUI and gets to the post-install scripts, my one and only interactive script causes problems.

Basically, I think my script is waiting for input, but (Anaconda?) is hiding the interface. What I see is the graphical install, but it sits there at post-install.

The script is there to ask for the hostname:

Quote:
function sethostname
{
#setup hostname
echo "`date`,sethostname,start" >> $LOG
exec < /dev/tty6 > /dev/tty6
chvt 6
FILE=/etc/sysconfig/network
clear
echo -n "What is my hostname?? : "
read linein
linein=`echo $linein | tr '[:lower:]' '[:upper:]'`
#remove old
cp $FILE $FILE.centos
grep -v HOSTNAME= $FILE.centos > /tmp/a
echo HOSTNAME=$linein >> /tmp/a
mv /tmp/a $FILE
echo "OK: Hostname will be $linein"
echo "`date`,sethostname,stop,$LINEIN" >> $LOG
}
sethostname is called from a script higher up. I found I had to switch tty's.

My ks.cfg is:

Quote:
#platform=x86, AMD64, or Intel EM64T
#vnc --password=secret
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --linux --initlabel
autopart
# Use graphical install
graphical
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard uk
# System language
lang en_GB
# Installation logging level
logging --level=info
# Use network installation
url --url=http://centosmirror.ubiquisys.local/centos/5/os/i386/
repo --name Updates --baseurl=http://centosmirror.ubiquisys.local/centos/5/updates/i386/
#Root password
rootpw --iscrypted xxxxxx
# SELinux configuration
selinux --permissive
# System timezone
timezone Europe/London
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig --defaultdesktop=GNOME --depth=8 --resolution=1024x768
reboot
#POST Install scripts
%post
cd /root
TESTING=TRUE
echo "cd /root
rm /root/post-script-testing.sh 2> /dev/null
wget http://centosmirror.ubiquisys.local/...ipt-testing.sh
sh /root/post-script-testing.sh
rm -f /root/post-script-testing.sh" > run.sh
sh run.sh


(post-script-testing.sh is the parent script that in turn calls the function sethostname)
 
Old 07-08-2009, 02:44 PM   #2
Dump_Weed
LQ Newbie
 
Registered: Jul 2009
Posts: 12

Rep: Reputation: 0
We use kick start with cobbler and build the profiles for the servers etc. The best way is to do a text install and feed it all the required information.
 
Old 07-10-2009, 08:43 AM   #3
adrianmarsh
LQ Newbie
 
Registered: Aug 2007
Posts: 4

Original Poster
Rep: Reputation: 0
Cobbler ?
 
Old 08-10-2009, 09:37 PM   #4
mcjohn87
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Rep: Reputation: 0
Cool

thanks so much for useful info
 
Old 08-10-2009, 09:37 PM   #5
mcjohn87
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Rep: Reputation: 0
Smile

Great work .. really informative .. and thanks a lot for sharing ..
script install
 
  


Reply

Tags
anaconda, centos, gui, kickstart


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Post script in kickstart qiuzhihong Linux - Software 1 04-19-2008 03:52 AM
FC6 kickstart doesn't post install pete@cosc. Fedora - Installation 2 01-15-2007 08:54 PM
running %post script for Mailserver through kickstart abhi2778 Fedora 0 09-06-2006 03:12 AM
rh9 kickstart post install help stockcowboy Linux - Newbie 1 12-05-2003 11:45 AM
Kickstart Post-install tasks TheRealDeal Linux - General 0 09-03-2003 01:13 AM


All times are GMT -5. The time now is 07:33 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration