[CentOS] kickstart file problem

Thu Feb 14 18:32:48 UTC 2008
Ross S. W. Walker <rwalker at medallion.com>

Lundgren, Andrew wrote:
> 
> I have a kickstart file that I am using to install multiple 
> machines.  If I install with no %post script, everything runs 
> great.  When I add the following %post section, if fails.
>  
> I have been working on this for a few days now without luck,  
> Any help would be appreciated.
>  
> Here is the error, the script follows.
>  
> Traceback (most recent call first):
>   File "/usr/lib/anaconda/kickstart.py", line 82, in run
>     os.unlink(path)
>   File "/usr/lib/anaconda/kickstart.py", line 781, in <lambda>
>     map (lambda s: s.run(anaconda.rootPath, serial, anaconda.intf), postScripts)
>   File "/usr/lib/anaconda/kickstart.py", line 781, in postAction
>     map (lambda s: s.run(anaconda.rootPath, serial, anaconda.intf), postScripts)
>   File "/tmp/treedir.17875/instimage/usr/lib/anaconda/packages.py", line 44, in doPostAction
>     anaconda.id.instClass.postAction(anaconda, flags.serial)
>   File "/usr/lib/anaconda/dispatch.py", line 201, in moveStep
>     rc = stepFunc(self.anaconda)
>   File "/usr/lib/anaconda/dispatch.py", line 124, in gotoNext
>     self.moveStep()
>   File "/usr/lib/anaconda/gui.py", line 1007, in nextClicked
>     self.anaconda.dispatch.gotoNext()
>   File "/usr/lib/anaconda/iw/progress_gui.py", line 243, in renderCallback
>     self.intf.icw.nextClicked()
>   File "/usr/lib/anaconda/gui.py", line 1034, in handleRenderCallback
>     self.currentWindow.renderCallback()
> OSError: [Errno 2] No such file or directory: '/mnt/sysimage/tmp/ks-script-ah2YMC'
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There's the error, and...

<snip>

>  
> My script that I add is listed above, but a less cryptic 
> version is here:
> %post --log=/mnt/sysimage/root/post-install.log
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There's the problem, should be /root/post-install.log as this runs chrooted.

> # setup NTP
> echo "setup NTP"
> cat << EOF > /etc/ntp.conf
> restrict default noquery notrap nomodfiy
> restrict 127.0.0.1
> server 0.rhel.ntp.org
> server 1.rhel.ntp.org
> server 2.rhel.ntp.org
> driftfile /var/lib/ntp/drift
> EOF
> /sbin/chkconfig ntpd on
> # setup services.
> echo "setup services"
> /sbin/chkconfig atd off
> /sbin/chkconfig autofs off
> /sbin/chkconfig avahi-daemon off
> /sbin/chkconfig bluetooth off
> /sbin/chkconfig cpuspeed off
> /sbin/chkconfig cups off
> /sbin/chkconfig gpm off
> /sbin/chkconfig hidd off
> /sbin/chkconfig ip6tables off
> /sbin/chkconfig pcscd off
> /sbin/chkconfig netfs --add
> /sbin/chkconfig netfs on
> # relocate tmp
> echo "relocate root"
> rm -rf /tmp
> ln -s /var/tmp /tmp
> # add lustre module configuration
> echo "add lustre module configuration"
> echo "options lnet networks=tcp0(eth1,eth0)" >> /etc/modprobe.conf
> # create motd
> echo "set motd"
> echo "Built as admin/ingest using VIPER install 1.0" > /etc/motd
> echo "Adding level3 with bad password set"
> /usr/sbin/useradd -d /home/level3 -m -u 100 -g 100 -p BLOCKED level3

-Ross


______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.