Closed Bug 477724 Opened 15 years ago Closed 15 years ago

[unix patch] avoid pointless shell interpreter hanging around

Categories

(Firefox Build System :: General, defect)

x86
Linux
defect
Not set
normal

Tracking

(blocking1.9.2 -, status1.9.2 .17-fixed, status1.9.1 wontfix)

RESOLVED FIXED
mozilla1.9.3a1
Tracking Status
blocking1.9.2 --- -
status1.9.2 --- .17-fixed
status1.9.1 --- wontfix

People

(Reporter: walters, Assigned: karlt)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6) Gecko/2009020410 Fedora/3.0.6-1.fc10 Firefox/3.0.6 Ubiquity/0.1.5
Build Identifier: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.6) Gecko/2009020410 Fedora/3.0.6-1.fc10 Firefox/3.0.6 Ubiquity/0.1.5

Right now the run-mozilla.sh script launcher in the normal case (i.e. launching Firefox from applications menu) does a bunch of work to check for debug flags, then runs the target process, and exits with its exit code.

It's more efficient and generally all around better to just exec the child in this case.  This way there's no pointless shell interpreter hanging around, and anyone scripting firefox launching can know that the pid they get back when they launch /usr/bin/firefox *is* firefox, not a shell script interpreter parent.



Reproducible: Always

Steps to Reproduce:
1. Launch firefox
Actual Results:  
shell interpreter parent hanging around

Expected Results:  
no shell interpreter
Attached patch exec child (obsolete) — Splinter Review
This patch is against the run-mozilla.sh in Fedora 10.
Assignee: nobody → mozbugz
Assignee: mozbugz → nobody
Status: UNCONFIRMED → ASSIGNED
Component: General → Build Config
Ever confirmed: true
Product: Firefox → Core
QA Contact: general → build-config
Assignee: nobody → mozbugz
Attached patch always execSplinter Review
run_mozilla.sh now no longer has DEBUG_CORE_FILES (bug 467638), so by using parameters to get rid of tmpfile there is now never any need to keep the shell(s) running.
Attachment #361414 - Attachment is obsolete: true
Attachment #394923 - Flags: review?
This patch also happens to work around NSS issues with passing arguments through perl on Fedora 11 (bug 497251 comment 51).
Attachment #394923 - Flags: review? → review?(benjamin)
I like this patch very much, thanks!
Attachment #394923 - Flags: review?(benjamin) → review+
Thanks, Colin, for the nudge; I'd kind of wanted to do this for some time.

http://hg.mozilla.org/mozilla-central/rev/9ab3645be5aa
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Thanks for taking the patch and fixing it up into an apply-able state =)
status1.9.1: --- → ?
status1.9.2: --- → ?
The patch could remove more. exitcode=$? becomes dead code. This includes the exit $exitcode which appears after functions which do not return

Also, to make sure, this will fix Thunderbird too? Thunderbird has two parents hanging around
(In reply to comment #8)
> The patch could remove more. exitcode=$? becomes dead code. This includes the
> exit $exitcode which appears after functions which do not return

I didn't know that bash sometimes exits on error during exec.

"If command cannot be executed for some reason, a non-interactive shell  exits,
 unless the shell option execfail is enabled, in which case it returns failure."

But the man pages for dash and zsh don't seem to be so clear.
Attachment #394923 - Flags: approval1.9.2.16?
Comment on attachment 394923 [details] [diff] [review]
always exec

Approved for 1.9.2.16, a=dveditz for release-drivers

Approval doesn't automatically result in landing. We're not blocking on this patch and if it doesn't make it by the non-blocking code-freeze (Thursday Mar 17) then approval will be removed.
Attachment #394923 - Flags: approval1.9.2.16? → approval1.9.2.16+
blocking1.9.2: --- → -
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: