Bug 445838 - 'Log custom post scripts' triggers a problem in kickstart post section can generate invalid files
'Log custom post scripts' triggers a problem in kickstart post section can ge...
Product: Red Hat Satellite 5
Classification: Red Hat
Component: Provisioning (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Justin Sherrill
Steve Salevan
Depends On:
Blocks: 429319
  Show dependency treegraph
Reported: 2008-05-09 06:56 EDT by Issue Tracker
Modified: 2010-10-22 20:51 EDT (History)
2 users (show)

See Also:
Fixed In Version: sat511
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-08-13 15:03:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Issue Tracker 2008-05-09 06:56:10 EDT
Escalated to Bugzilla from IssueTracker
Comment 1 Issue Tracker 2008-05-09 06:56:11 EDT
Description of problem:
Kicktarts are generated 'on request' by the RHN Satellite. A new feature of RHN Satellite 5.1 is a 'Log custom post scripts' where you can log custom post scripts. When this feature is enabled, an entry is added to the post section of the kickstart to redirect logs to /root/ks-post.log . 

The problem is intermittant approximately every second time the kickstart is accessed an extra line is placed in the kickstart file, causing a syntax error for the anaconda installer.

How reproducible:

Steps to Reproduce:

Install RHN Satellite 5.1. 
Populate the usual channels as required
Create a kickstart with the feature Log custom post scripts:   check box CHECKED.	

kickstart a system using the new kickstart. About every second attempt anaconda will error out at the post script stage.

An easy way to observe the problem and it's cause is to visit the download link :

Actual results:

At the end of the kickstart file , about 50% of the time you will see the following:

%post --interpreter /bin/bash
/bin/ls > /tmp/ls.out
) >> /root/ks-post.log 2>&1
) >> /root/ks-post.log 2>&1

Notice the replicated line at the end. This is a script syntax error for anaconda installer.

Expected results:
End of the kickstart file should have a single line added for the script logging every time the kickstart file is accessd and generated by the RHN Satellite:

%post --interpreter /bin/bash
/bin/ls > /tmp/ls.out
) >> /root/ks-post.log 2>&1

Additional info:
satellite-debug for the RHN Satellite in question is attached

This event sent from IssueTracker by mpoole  [SEG - RHN]
 issue 179369
Comment 2 Martin Poole 2008-05-09 07:05:03 EDT
I did 100 fetches of the kickstart mentioned. There was a duplicate redirect
line in almost 25% of them.
Comment 4 Justin Sherrill 2008-05-09 14:17:37 EDT
weird, seems to have to do with a %post being a nochroot script....
Comment 5 Justin Sherrill 2008-05-09 15:24:08 EDT
fixed in rev 172368 for trunk and rev 172369.
Comment 7 Steve Salevan 2008-06-16 15:13:48 EDT
After wgetting 10 ks cfg files repeatedly for both chroot and nonchroot logged
post scripts I cannot reproduce the issue, so it looks like we're fixed here. 
Moving to VERIFIED.
Comment 9 Brandon Perkins 2008-08-13 15:03:46 EDT
5.1.1 Satellite is now GA, bugs Closed for Current Release.
Comment 10 Brandon Perkins 2008-08-13 15:08:50 EDT
5.1.1 Satellite is now GA, bugs Closed for Current Release.

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