Logging?

Neil redhat at iamafreeman.com
Tue Nov 23 23:53:15 UTC 2004


On Monday 22 November 2004 18:15, Chris Adams wrote:
> Once upon a time, Chris Mckenzie <Chris.McKenzie at entrust.com> said:
> > Does anyone have any suggestions on handling kickstart installation
> > failure logging? If a kickstart succeeds in installing, I know because my
> > post script runs. If it fails, either within the middle of the ks process
> > or fails to run my post script, the system will reboot without pausing to
> > let me know what the problem was.
>
> I capture the output of my %post script by doing:
>
>   %post
>   cat > /post-install <<EOF
>   # script goes here
>   # must change "$" to "\$" and "`" to "\`" to avoid shell quoting
>   EOF
>   /bin/bash -x /post-install < /dev/null 2>&1 | tee /post-install.log
>
> It would be nice if there was a %post option to save the output.

Just throwing in my 10c

I use

cat > /file<<EOF

redirections throughout my %post section so to capture the logs I use

%post
(
#script in here including
echo adding /etc/profile.d/completehistoryetc.sh
/bin/cat > /etc/profile.d/completehistoryetc.sh << EOF
set complete=1
set autolist=1
set HISTSIZE=2000
set nobeep=1
export EDITOR=vim
export HISTCONTROL=ignoreboth
shopt -s histverify
EOF
chmod 755 /etc/profile.d/completehistoryetc.sh

# blah blah
) >& /root/kspost.output

%post --nochroot
cp -rf /tmp /mnt/sysimage/root/kickstart_tmp

-----------------

that last bit copies the kickstart file and some logs  into the new sysimage

Neil




More information about the Kickstart-list mailing list