[Date Prev][Date Next] [Thread Prev][Thread Next]
RE: RHEL5/CentOS5 KS Network Oddities (ifcfg-* gets re-written)
- From: "Shabazian, Chip" <Chip Shabazian bankofamerica com>
- To: kslist devo com, Discussion list about Kickstart <kickstart-list redhat com>
- Subject: RE: RHEL5/CentOS5 KS Network Oddities (ifcfg-* gets re-written)
- Date: Thu, 27 Sep 2007 08:20:22 -0700
I don't see why you can't ask your network questions in %pre. You say
you can't (and say "see below"), but I don't see anything below (or
above) that prevents you from doing it this way.
From: kickstart-list-bounces redhat com
[mailto:kickstart-list-bounces redhat com] On Behalf Of kslist
Sent: Thursday, September 27, 2007 6:00 AM
To: Discussion list about Kickstart
Subject: Re: RHEL5/CentOS5 KS Network Oddities (ifcfg-* gets re-written)
here's how I fixed it:
This is way at the end of my %post:
# Finish local network setup
cat <<EOF > /mnt/sysimage/root/net.conf.sh
echo -e " ** Completing network setup..."
mv /etc/sysconfig/network.new /etc/sysconfig/network
mv /etc/sysconfig/network-scripts/ifcfg-eth0.new \
if [ -f /etc/sysconfig/network-scripts/ifcfg-eth1.new ] ; then
mv /etc/sysconfig/network-scripts/ifcfg-eth1.new \
mv /etc/hosts.new /etc/hosts
mv /etc/resolv.conf.new /etc/resolv.conf
service network restart
sed -e 's/^\/root\/net\.conf\.sh//' /etc/rc.local > /tmp/rc.local
mv /tmp/rc.local /etc/rc.local
rm -f /root/net.conf.sh
chmod 755 /mnt/sysimage/root/net.conf.sh
# Set the rc.local to move the new network config into place
cat <<EOF >> /mnt/sysimage/etc/rc.local
Now, why do I do something that horrible? The reason is this: my
is interactive. My kickstart asks the installer various questions, such
hostname, IP, etc., and it sets the config files apropriately (ie, it
wrotes directly into /etc/sysconfig/network-scripts/ifcfg-eth0, etc.)
So to answer the questions:
- I can't config in %pre, because of the infelxibility of the "network"
directive (see below)
- I used the option "firstboot --disable" to turn off firstboot, yet the
network configuration files still get mangled somehow.
- I want to use DHCP _for the installation_ only, I do not want to use
DHCP _for the installed system_.
- I actually don't mind first-boot running, because it does other useful
- Firstboot SHOULD NOT be connected to the kickstart "network"
They should not be coupled at all. OR, there has got to be an option for
"network" and "firstboot" that allows me to use DHCP for the install
process and still use fixed IPs for the installed system
As you can see from my work-around, I use /etc/rc.local to overwrite the
files that first-boot mangles, and since its a one-time event, I also
rc.local to remove the from itself so that the re-write script is never
called after that first time, and the shell script that does the
re-writing itself is also erased.
This is really a terrible thing, to have to do that, and a result from
kick-start 'doing a little too much thinking" for me, if I may
respectfully put it that way. ;)
If there is a better solution, I'm all ears! =)
On Wed, September 26, 2007 19:27, John Wang wrote:
> Hello Christian
> How about putting the following into your %post:
> echo "RUN_FIRSTBOOT=NO" > /etc/sysconfig/firstboot
> That should fool firstboot into thinking that it already ran...
> On 9/25/07 6:02 PM, "kslist" <kslist devo com> wrote:
>> Hello KSers,
>> I am using my Kickstart script that I have adapted from RHEL 2.1, 3,
>> now on CentOS 5. CentOS 5 behaves differently when it comes to
>> In essence: AFTER the successfull installation, during the first
>> of the OS, something desctroys my network configuration.
>> files that I have directly written in my %post script:
>> are modified, and in the case of the ifcfg-* scripts, my scripts are
>> to a *.bak file (which have a datestamp later than the files I
>> %post, and which correspond to the firstboot) and a completely
>> created in its place.
>> The network configuration that replaces my own is one for DHCP.
>> My guess is that this is a result of a change in behaviour of the
>> "network" option. To quote from the RHEL 5 Installation Guide:
>> "Configures network information for the system. If the kickstart
>> installation does not require networking (in other words, it is not
>> installed over NFS, HTTP, or FTP), networking is not configured for
>> system. If the installation does require networking and network
>> information is not provided in the kickstart file, the installation
>> program assumes that the installation should be done over eth0 via a
>> dynamic IP address (BOOTP/DHCP), and configures the final, installed
>> system to determine its IP address dynamically. The network option
>> configures networking information for kickstart installations via a
>> network as well as for the installed system."
>> Now, I see a problem here:
>> - I use DHCP to install the system (via Kickstart)
>> - I however do NOT want to run the subsequently installed OS to use
>> I would say that is a very very normal thing to want.
>> However, the way the manual describes it, and from the behaviour I
>> seen, it is not possible to install via DHCP, and then setup your own
>> network configuration in %post, because your configuration will be
>> overwritten next time you boot the system.
>> Ussing "firstboot --disable" doesn't help.
>> Please help!
>> Kickstart-list mailing list
>> Kickstart-list redhat com
> Kickstart-list mailing list
> Kickstart-list redhat com
Kickstart-list mailing list
Kickstart-list redhat com
[Date Prev][Date Next] [Thread Prev][Thread Next]