Bug 147109 - RFE: Need a way to indicate progress in %post scripts
Summary: RFE: Need a way to indicate progress in %post scripts
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: anaconda
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Chris Lumens
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-02-04 13:58 UTC by Peter Eriksson
Modified: 2007-11-30 22:10 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-08-24 17:21:06 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Peter Eriksson 2005-02-04 13:58:18 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; SunOS sun4u; rv:1.7.3) Gecko/20040916
Firefox/0.10

Description of problem:
I'd like to see some portable way to indicate progress when
executing %post scripts since they might take a long time! 

For example I normally run a "yum -y update" in my post scripts, 
and then the users waiting for the installation to finish only
see (if using the graphical installer) the last message printed
by Anaconda, and nothing at all if using text mode on a server.

It would be nice to be able to call something like:

    /sbin/anaconda-status "Installing patches"

This should update the X status windows of Anaconda if using
the graphical installer, or the text window if using text mode.


Version-Release number of selected component (if applicable):


How reproducible:
Always

Steps to Reproduce:
na.
    

Additional info:

Comment 1 Matthew Miller 2006-07-10 22:56:45 UTC
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!


Comment 2 Red Hat Bugzilla 2007-06-12 02:26:49 UTC
requested by Jams Antill

Comment 3 Orion Poplawski 2007-07-27 16:02:00 UTC
Also nice to have:

- Output of %post automatically logged to /root/ks-post.log or some such place.
- Output of %post displayed on anaconda screen in addition to status updates. 
Would need in text mode as well as graphical.

Comment 4 Chris Lumens 2007-07-31 19:28:28 UTC
All %pre/%post/%traceback scripts have their stdout and stderr written to the
anaconda log file.  This can be found in /tmp/anaconda.log during installation
and /var/log/anaconda.log afterwards.

As for displaying progress, my initial experiments here involved trying to use
zenity to display a progress widget, but it's not quite working yet.  This might
be something that other people can experiment with in their own %post scripts
and see if they can make it work.

Comment 5 Orion Poplawski 2007-08-03 14:57:31 UTC
(In reply to comment #4)
> All %pre/%post/%traceback scripts have their stdout and stderr written to the
> anaconda log file.  This can be found in /tmp/anaconda.log during installation
> and /var/log/anaconda.log afterwards.

Is this a devel only feature?  I just did a F7 install and I don't see any
output from %post in /var/log/anaconda.log.(In reply to comment #4)

> As for displaying progress, my initial experiments here involved trying to use
> zenity to display a progress widget, but it's not quite working yet.  This might
> be something that other people can experiment with in their own %post scripts
> and see if they can make it work.

I'd be happy to play around with it if I could get pointed in the right direction.

Comment 6 Chris Lumens 2007-08-03 17:23:59 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > All %pre/%post/%traceback scripts have their stdout and stderr written to the
> > anaconda log file.  This can be found in /tmp/anaconda.log during installation
> > and /var/log/anaconda.log afterwards.
> 
> Is this a devel only feature?  I just did a F7 install and I don't see any
> output from %post in /var/log/anaconda.log.(In reply to comment #4)

> I'd be happy to play around with it if I could get pointed in the right direction.

zenity is just a little program that generates GTK widgets, similar to the
dialog program.  I think the hard part here is going to be making sure the
$DISPLAY is correct.  This may require code changes in anaconda.

Comment 7 Chris Lumens 2007-08-06 18:58:13 UTC
> (In reply to comment #4)
> > All %pre/%post/%traceback scripts have their stdout and stderr written to the
> > anaconda log file.  This can be found in /tmp/anaconda.log during installation
> > and /var/log/anaconda.log afterwards.
> 
> Is this a devel only feature?  I just did a F7 install and I don't see any
> output from %post in /var/log/anaconda.log.(In reply to comment #4)

No, this should be available as least as far back as FC6.  stdout and stderr is
supposed to be getting redirected to the log files.  You can also use --logfile
in the script's header to direct output wherever you want.  If that stuff's not
working, it's a bug.

Comment 8 Chris Lumens 2007-08-08 16:42:34 UTC
zenity is now in the stage2 image, so you can do progress bars, dialogs, and the
like in your %pre and %post scripts.  Because of rawhide being broken right now,
I was only able to test this in the %pre script but it works there.  You
probably won't be able to run this from inside a chrooted %post script.

On the logging thing - you are correct.  The output is not logged to
/tmp/anaconda.log though it is being logged to tty3.  I don't think this is
possible to fix right now, because it would require making the python subprocess
module redirect its output to the python logging module.  This could be
something to investigate later.  However, you still have the --logfile parameter
which should capture everything.

I'm going to put this in MODIFIED until we see that zenity works in %post as well.

Comment 9 Orion Poplawski 2007-08-27 17:44:38 UTC
zenity is a gui only thing, right?  Anything that will work in text mode install?

Comment 10 Chris Lumens 2007-08-28 14:27:54 UTC
That is correct.  zenity is only a gui thing.  There is currently nothing for
text mode, nor is there really anything planned.  We can't just drop in a
program like dialog and let people start using it, because newt thinks it's in
control of the interface  and displaying anything else is going to break that
assumption.


Note You need to log in before you can comment on or make changes to this bug.