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'
Local variables in
innermost frame:
intf: <gui.InstallInterface instance at
0x2aaab6572a28>
tempfile: <module 'tempfile' from
'/usr/lib64/python2.4/tempfile.py'>
self: (s: '# 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|' i: /bin/sh c: 1)
messages:
/mnt/sysimage/root/post-install.log
scriptRoot: /mnt/sysimage
chroot:
/mnt/sysimage
fd: 31
rc: 0
path:
/mnt/sysimage/tmp/ks-script-ah2YMC
serial: 0
os: <module 'os' from
'/usr/lib64/python2.4/os.py'>
My script that I add
is listed above, but a less cryptic version is here:
%post
--log=/mnt/sysimage/root/post-install.log
# 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