Looking for saved searches? click on "Search Bugs" above.

Dangling shell processes in run-mozilla.sh and the like; use exec

RESOLVED DUPLICATE of bug 477724

Status

()

Core
General
--
minor
RESOLVED DUPLICATE of bug 477724
7 years ago
7 years ago

People

(Reporter: Demur Rumed, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100908 Firefox/3.6.9
Build Identifier: 

Currently, the end of thunderbird (The shell script calling thunderbird-bin) is
"$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"
exitcode=$?

exit $exitcode

Superior would be

exec "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"

This is not only on account of code style, but of processes. Use top to compare the before and after to see that this change allows thunderbird to close and leave thunderbird-bin running, rather than keep an instance of sh waiting with hogged memory

This isn't only thunderbird, as I'm sure the style is found elsewhere. Such as the more ubiquitos run-mozilla.sh:

if [ $moz_debug -eq 1 ]
then
	moz_debug_program ${1+"$@"}
else
	moz_run_program ${1+"$@"}
fi

exit $exitcode

Where moz_run_program and moz_debug_program can be rewritten to instead use exec as I have shown above instead of exitcode=$? and then returning to execute exit $exitcode

In the case of thunderbird, this allows two instances of sh to be closed. On my particular system, that's two instances of bash: 1/16th the memory use of Thunderbird. For all the work going on to conserve memory, this seems a rather low bearing fruit

Reproducible: Always
(Reporter)

Updated

7 years ago
Status: UNCONFIRMED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 477724
You need to log in before you can comment on or make changes to this bug.