Bug 237317 - post scripts execute in chroot but with cwd of real /
post scripts execute in chroot but with cwd of real /
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: anaconda (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Chris Lumens
Depends On:
  Show dependency treegraph
Reported: 2007-04-20 15:28 EDT by Thomas Vander Stichele
Modified: 2007-11-30 17:07 EST (History)
1 user (show)

See Also:
Fixed In Version: RHBA-2007-0644
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2007-11-07 12:21:33 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
set cwd for scripts (1.35 KB, patch)
2007-04-23 11:45 EDT, Chris Lumens
no flags Details | Diff

  None (edit)
Description Thomas Vander Stichele 2007-04-20 15:28:10 EDT
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:

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

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 11:45:13 EDT
Created attachment 153287 [details]
set cwd for scripts

I'm attaching a patch that corrects this issue for my future reference.
Comment 2 RHEL Product and Program Management 2007-04-23 12:04:27 EDT
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
Comment 5 Milan Zázrivec 2007-09-06 07:11:53 EDT
Verified with RHEL5.1-Server-20070906.nightly
Comment 7 errata-xmlrpc 2007-11-07 12:21:33 EST
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.


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