Monday, August 20, 2012

Capturing %Post Kickstart Install output

I found this very very useful in troubling my provisioning systems to find out what happend in the post install script output of kickstart.  The tee command is very useful for this.




%post --interpreter /bin/bash
(
scripting goes here

) |  2>&1 | tee /root/post-log.log

In your kickstart file add something like this.




%post --interpreter /bin/sh
(
# mount disk from the NFS server which contains support files
mkdir -p /mnt/tmp
mount nfs:volume /mnt/tmp
# run the top-level post-install script
cd /mnt/tmp
. ./postinstall.sh
cd /
# unmount the disk and delete the mount point
umount /mnt/tmp
rmdir /mnt/tmp )  2>&1 | tee /root/post-log.log
# post-installation script ends