Bug 147109 - RFE: Need a way to indicate progress in %post scripts
RFE: Need a way to indicate progress in %post scripts
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: anaconda (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Lumens
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-02-04 08:58 EST by Peter Eriksson
Modified: 2007-11-30 17:10 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-08-24 13:21:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Peter Eriksson 2005-02-04 08:58:18 EST
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 18:56:45 EDT
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-11 22:26:49 EDT
requested by Jams Antill
Comment 3 Orion Poplawski 2007-07-27 12:02:00 EDT
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 15:28:28 EDT
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 10:57:31 EDT
(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 13:23:59 EDT
(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 14:58:13 EDT
> (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 12:42:34 EDT
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 13:44:38 EDT
zenity is a gui only thing, right?  Anything that will work in text mode install?
Comment 10 Chris Lumens 2007-08-28 10:27:54 EDT
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.