Bug 535012 (RHQ-1752)
| Summary: | on Solaris and HP-UX (and AIX?), we can try to work around the missing readlink problem | ||
|---|---|---|---|
| Product: | [Other] RHQ Project | Reporter: | John Mazzitelli <mazz> |
| Component: | Launch Scripts | Assignee: | RHQ Project Maintainer <rhq-maint> |
| Status: | CLOSED NEXTRELEASE | QA Contact: | |
| Severity: | medium | Docs Contact: | |
| Priority: | low | ||
| Version: | unspecified | CC: | jshaughn |
| Target Milestone: | --- | Keywords: | FutureFeature, Improvement |
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| URL: | http://jira.rhq-project.org/browse/RHQ-1752 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Enhancement | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2014-05-05 15:21:24 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: | |||
| Bug Depends On: | 625146 | ||
| Bug Blocks: | 1088032 | ||
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-1752 This bug is related to RHQ-1391 This bug relates to RHQ-1520 mass add of key word FutureFeature to help track Similar suggestion has been done in JBAS: http://old.nabble.com/Symlinks-and-JBoss-AS-.-bin-*.sh-scripts-td30324231.html#a30324231 |
If readlink does not exist, we could recursively parse the output of ls -ld which, for symlinks, has the form "name -> target". Note that we don't want to assume /usr/bin - I would just leave those full paths out and assume that $PATH points to ls, expr, and dirname (since there might be those people that have those in /bin or /usr/local/bin or wherever). # Resolve symlinks. while [ -h "$PRG" ]; do ls=`/usr/bin/ls -ld "$PRG"` link=`/usr/bin/expr "$ls" : '^.*-> \(.*\)$'` if /usr/bin/expr "$link" : '^/'> /dev/null; then prg="$link" else prg="`/usr/bin/dirname $PRG`/$link" fi PRG=`whence "$prg"`> /dev/null 2>&1 APPHOME=`/usr/bin/dirname "$PRG"` done (found this here: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4789162 )