Bug 752044

Summary: open kickstart log files to append
Product: Red Hat Enterprise Linux 5 Reporter: Philip Rowlands <phr>
Component: anacondaAssignee: Anaconda Maintenance Team <anaconda-maint-list>
Status: CLOSED WONTFIX QA Contact: Release Test Team <release-test-team>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.7   
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-03-20 17:47:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Philip Rowlands 2011-11-08 12:11:17 UTC
In my %pre and %post scripts, I have this:

# force output to append to the logfile
exec 1>>/proc/self/fd/1
exec 2>>/proc/self/fd/2

Without these lines, /tmp/ks-script-XXXXXX.log is lossy, because interleaved stdout and stderr output clobber each other.

Suggest changing iutil.execWithRedirect to open files for append, rather than write. If this is too broad, perhaps AnacondaKSScript.run() could open the logfile for appending and pass the fds to execWithRedirect.

Comment 1 Philip Rowlands 2012-03-08 10:20:07 UTC
Hmm, not much interest in this bug :(

Perhaps a change to iutil:execWithRedirect to add a new named parameter, defaulting to the current behaviour, e.g

def execWithRedirect(command, argv, stdin = 0, stdout = 1, stderr = 2,
                     searchPath = 0, root = '/', writeAppend=False):

  if writeAppend:
    mode="a"
  else:
    mode="w"

...

This would probably apply to execWithCapture as well, although I don't know what calls that function.

Comment 2 David Cantrell 2013-03-20 17:47:37 UTC
While Red Hat welcomes bug reports on Red Hat products here in our public
bugzilla database, please keep in mind that bugzilla is not a support tool or
means of accessing support.  If you would like technical support please visit
our support portal at access.redhat.com or call us for information on
subscription offerings to suit your needs.

Comment 4 Philip Rowlands 2013-03-20 22:22:33 UTC
Support case 00808889 filed, as requested.

Comment 5 David Cantrell 2013-03-21 16:23:59 UTC
This request is out of scope for the types of updates that are being accepted for RHEL 5.10.  Rather than drag this one on forever, the reality is we are likely to never change it in RHEL-5 at this point.

Comment 6 Philip Rowlands 2013-03-22 09:52:26 UTC
Hi David,
I appreciate there's limited scope for work on the one remaining update to RHEL 5.10. For completeness you could change the status to DUPLICATE (I don't have permission), as this exact issue was fixed in bug 702024:

* Wed Sep 07 2011 Martin Gracik <mgracik> 11.1.2.243-1
- Sanitize DASD device specifications (dcantrell)
  Resolves: rhbz#689470
- Add /dev/stdin, /dev/stdout, /dev/stderr to initrd.img (dcantrell)
  Resolves: rhbz#684220
- Single quote values in show_parms() in linuxrc.s390 (dcantrell)
  Resolves: rhbz#681219
- Make execWithRedirect() append to the files. (akozumpl)
  Resolves: rhbz#702024

and released along with fixes for my s390 bugs :)