Bug 1004008 - jbossews setup script fails to correctly remove symlinked lib directory
Summary: jbossews setup script fails to correctly remove symlinked lib directory
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Dan Mace
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-09-03 17:18 UTC by Dan Mace
Modified: 2015-05-14 23:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-09-19 16:49:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Dan Mace 2013-09-03 17:18:36 UTC
Description of problem:

The jbossews setup script attempts to remove preexisting symlinks to the lib directory:

[ -e ${OPENSHIFT_JBOSSEWS_DIR}/lib ] && rm ${OPENSHIFT_JBOSSEWS_DIR}/lib

However, the -e test will pass if `lib` is a physical directory, causing the subsequent `rm` to fail due to a lack of the -r option.

This check should use the -h test to ensure the target of the rm is a symlink.

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


How reproducible:

Upgrade an older jbossews application containing a symlinked ~/jbossews/lib directory.


Steps to Reproduce:
1.
2.
3.

Actual results:

An error during setup:

rm: cannot remove `/var/lib/openshift/.../jbossews//lib': Is a directory

Expected results:

Successful setup execution.

Additional info:

Comment 2 openshift-github-bot 2013-09-03 21:30:11 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/f2563d3d09c3dbd1da5dc3f122de59ffd5026657
Bug 1004008: Use symlink test rather than -e before call to rm

Comment 3 Meng Bo 2013-09-04 04:46:28 UTC
Tested on devenv-stage_461,

1. Create jbossews app
2. Manually replace the lib symlink with real dir under jbossews dir for the gear
3. Run oo-admin-upgrade to re-setup the gear

No error when upgrading.

Move bug to verified.


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