Bug 965827 - /etc/openshift/env/PATH is not replaced on upgrade, leading to garbage default PATH
Summary: /etc/openshift/env/PATH is not replaced on upgrade, leading to garbage defaul...
Keywords:
Status: CLOSED DUPLICATE of bug 965357
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Jhon Honce
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-21 19:58 UTC by Andy Grimm
Modified: 2016-11-08 03:47 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-05-21 21:04:35 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Andy Grimm 2013-05-21 19:58:47 UTC
Description of problem:
If a gear does not have .env/PATH defined, the default PATH is ":export PATH=/bin:/usr/bin:/usr/sbin", which is not very useful.

Version-Release number of selected component (if applicable):
rubygem-openshift-origin-node-1.9.3-1.el6oso

How reproducible:
Always

Steps to Reproduce:
1. create an app (on the INT OpenShift right now).
2. rhc ssh <appname>
3. try to run "ls"


Actual results:
Connecting to <app-uuid>@<domain> ...
bash: cat: command not found
bash: cat: command not found
[\> ls
bash: ls: command not found
[\> echo $PATH
:export PATH=/bin:/usr/bin:/usr/sbin


Expected results:
PATH should be sane


Additional info:
/etc/openshift/env/PATH recently changed from "export PATH=/bin:/usr/bin:/usr/sbin" to "/bin:/usr/bin:/usr/sbin", which is necessary due to how rhcsh reads the file.  However, this file is marked as "%config(noreplace)" in the RPM, so it does not get upgraded.

The old format causes a problem because rhcsh reads the file like this:

    if [ -f /etc/openshift/env/PATH ]
    then
        path=$path:$(< /etc/openshift/env/PATH)
    fi
    export PATH=$path

rather than as shell code.

Comment 1 Jhon Honce 2013-05-21 21:04:35 UTC
Same root cause

*** This bug has been marked as a duplicate of bug 965357 ***


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