3

While anaconda kickstart installer runs the "Performing post-installation setup tasks" tasks are not visible on console and their outcome is only saved to ks-post.log file.

I do want to also display it on the console as these steps could take a long time and there is a clear need to see what happens in real time.

How can I do this?

sorin
  • 8,454

3 Answers3

4

I have used a method similar to what is shown below.

Logging %pre and %post

When using a %pre or %post script you can simply log the output to a file by using --log=/path/to/file

%post --log=/root/my-post-log
echo 'Hello, World!'
enter code here

Another way of logging and displaying the results on the screen would be the following:

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

From: https://wiki.centos.org/TipsAndTricks/KickStart

Aaron Copley
  • 12,954
3

I don't see any obvious way in the docs to log the %post script to console, but if you really need to see the script output while it's still running during installation, then you might try switching to another virtual console and running tail -f /mnt/sysimage/root/ks-post.log.

Michael Hampton
  • 252,907
0

Not sure how it will work with a serial console, but this is how I show progress on TTY3:

%post --interpreter /bin/bash

printf "\r\nChanging output to TTY 3; press Alt-F3 to view\r\n" > /dev/tty1

{
## do stuff
} 2>&1 | tee /root/postinstall.log > /dev/tty3
%end

See https://unix.stackexchange.com/questions/350415/cant-monitor-kickstart-post-install-log

miken32
  • 1,021