Bug 237317

Summary: post scripts execute in chroot but with cwd of real /
Product: Red Hat Enterprise Linux 5 Reporter: Thomas Vander Stichele <thomas>
Component: anacondaAssignee: Chris Lumens <clumens>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5.0CC: mzazrivec
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: RHBA-2007-0644 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2007-11-07 17:21:33 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
set cwd for scripts none

Description Thomas Vander Stichele 2007-04-20 19:28:10 UTC
Description of problem:

I had a post script that downloaded a setup script then runs it.  This script
installs an rpm, then runs a script from that rpm.  However, the script could
not install the rpm because it claimed it wasn't there.

Further inspection leads me to believe that:
- a post script gets executed inside the chroot (at /mnt/sysimage)
- its cwd is the real /, and not the chrooted /

This is evidenced by the fact that both the downloaded script and the rpm ended
up in /, and not in /mnt/sysimage where I expected them.

I used the same mechanism on FC5 without problems.



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


How reproducible:
Always

Steps to Reproduce:
1. Created a ks file
2. use this post script:
echo "one" > post.log
echo "two" > /root/post.log
3. install machine with ks file and check on the console
  
Actual results:

after completion of post scripts but before rebooting, machine has /post.log and
/mnt/sysimage/root/post.log


Expected results:
should have /mnt/sysimage/post.log and /mnt/sysimage/root/post.log

If it matters, my install was done over PXE, with vnc enabled.

Additional info:

Comment 1 Chris Lumens 2007-04-23 15:45:13 UTC
Created attachment 153287 [details]
set cwd for scripts

I'm attaching a patch that corrects this issue for my future reference.

Comment 2 RHEL Program Management 2007-04-23 16:04:27 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 5 Milan Zázrivec 2007-09-06 11:11:53 UTC
Verified with RHEL5.1-Server-20070906.nightly

Comment 7 errata-xmlrpc 2007-11-07 17:21:33 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2007-0644.html