Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using the following kickstart post installation logging options:

%post  
exec < /dev/tty3 > /dev/tty3  
chvt 3  
echo  
echo "################################"  
echo "# Running Post Configuration #"  
echo "################################"  
(  
  echo 'Hello, World!'  
  cat > test_file <<EOF  
  Hello World  
  EOF  
) 2>&1 | /usr/bin/tee /var/log/post_install.log  
chvt 1  

The problem is that I'm not actually capturing commands used to create the test_file (code beginning with cat and ending with EOF) in my log file. The echo statement is there but nothing more.

The following code solves the problem but will mean I have to append a tee statement to all of my post installation procedures, which is not satisfactory.

echo -e "# Writing test_file and capturing to log_file" && /usr/bin/tee -ai log_file >> test_file << EOF  
Hello World  
EOF  

The current log file created only captures echo statement which is not enough. I want to capture the commands executed complete with their associated options and arguments.

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

Post can automatically log:

%post --log=/root/kickstart-post.log

And running

set -x
should log all executed commands and arguments.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.