Bug 237317 - post scripts execute in chroot but with cwd of real /
Summary: post scripts execute in chroot but with cwd of real /
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: anaconda   
(Show other bugs)
Version: 5.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Chris Lumens
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-04-20 19:28 UTC by Thomas Vander Stichele
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

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: ---


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


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2007:0644 normal SHIPPED_LIVE anaconda bug fix and enhancement update 2007-10-30 22:56:59 UTC

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 Product and 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



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