bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

run-mozilla.sh doesn't work well with ksh93

RESOLVED FIXED

Status

()

Toolkit
Startup and Profile System
RESOLVED FIXED
10 years ago
9 years ago

People

(Reporter: Ginn Chen, Assigned: Ginn Chen)

Tracking

Trunk
x86
OpenSolaris
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 2 obsolete attachments)

(Assignee)

Description

10 years ago
On OpenSolaris, /bin/sh is ksh93.

I found two problems with run-mozilla.sh.

1) In ksh93, type is an alias for 'whence -v'
I've dbx in /opt/SUNWspro/bin/dbx
type dbx result is
dbx is a tracked alias for /opt/SUNWspro/bin/dbx
thus type ${d} | awk '{print $3;}' | sed -e 's/\.$//' result is "a" not "/opt/SUNWspro/bin/dbx"

2) /bin is symbolic link to ./usr/bin, /bin/firefox is symbolic link to ../lib/firefox/firefox
Firefox is in /usr/lib/firefox/firefox.
/bin/firefox would not start, because in "cd ../lib/firefox" would not work from /bin
We need to use "cd -P ../lib/firefox" instead.
"cd -P" is valid for ksh93 and bash, but not Bourne shell.


For problem 1, we can switch the priority of "which" and "type".
For problem 2, we can use "cd -P "$curdir" 2>/dev/null || cd "$curdir" as Roland Mainz suggested at
http://bugs.grommit.com/show_bug.cgi?id=559#c10

Or maybe we can add a patch just for Solaris, after installing firefox and run-mozilla.sh script to dist/bin replace #!/bin/sh to #!/bin/bash.

I wish the fix can be done in mozilla-central repository, so I won't hold this patch myself.
I really feel the inconvenience, every time I type "./dist/bin/firefox -g -d dbx", it fails.

Comment 1

9 years ago
Can you provide a patch?
Component: Cmd-line Features → Startup and Profile System
Product: Core → Toolkit
QA Contact: cmd-line → startup
(Assignee)

Comment 2

9 years ago
Created attachment 384383 [details] [diff] [review]
replace !/bin/sh to !/bin/bash on Solaris
Assignee: nobody → ginn.chen
Status: NEW → ASSIGNED
Attachment #384383 - Flags: review?(benjamin)

Comment 3

9 years ago
1) can't this be fixed by using /bin/type explicitly instead of bare type?
2) why is /bin/firefox a relative symbolic link? If that file is even part of our install target (I think it's not) it ought to be using an absolute symlink, not a relative one!

I don't particularly want to use bash if there's simple workarounds to make it sh-compatible.

Comment 4

9 years ago
Comment on attachment 384383 [details] [diff] [review]
replace !/bin/sh to !/bin/bash on Solaris

Clearing request. Please re-request if making is sh-compatible is really not practical.
Attachment #384383 - Flags: review?(benjamin)
(Assignee)

Comment 5

9 years ago
Created attachment 387145 [details] [diff] [review]
patch to make ksh compatible

1)
/bin/type works as same as bare type under ksh93.
So what I can do is to try to use /bin/which.

2)
Relative symbolic link is common, on Ubuntu, /usr/bin/firefox-3.0 is link to ../lib/firefox-3.0.10/firefox.sh.
The problem is on Solaris /bin is a symbolic link to ./usr/bin, and be default, ksh handles the operand dot-dot (..) logically.
So as Roland Mainz suggested, try to use option "-P" first.
Attachment #384383 - Attachment is obsolete: true
Attachment #387145 - Flags: review?(benjamin)

Comment 6

9 years ago
Comment on attachment 387145 [details] [diff] [review]
patch to make ksh compatible

Is cd -P portable?
Attachment #387145 - Flags: review?(benjamin) → review+
(Assignee)

Comment 7

9 years ago
Comment on attachment 387145 [details] [diff] [review]
patch to make ksh compatible

Unfortunately it's not.
And cd -P "$curdir" 2>/dev/null || cd "$curdir" can't get around.
Attachment #387145 - Attachment is obsolete: true
Attachment #387145 - Flags: review+
(Assignee)

Comment 8

9 years ago
Created attachment 389109 [details] [diff] [review]
patch v2

Use /bin/pwd to resolve symlink of dirname
Attachment #389109 - Flags: review?(benjamin)

Updated

9 years ago
Attachment #389109 - Flags: review?(benjamin) → review+
(Assignee)

Comment 9

9 years ago
http://hg.mozilla.org/mozilla-central/rev/d783d91beec5
Status: ASSIGNED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.