[clue-tech] SSH/Firefox crossover effect
Matt Gushee
mgushee at havenrock.com
Mon Jan 31 13:06:20 MST 2005
Jason S. Friedman wrote:
> But, if I launch Firefox from machine one, and do not shut
> down Firefox on machine one before launching Firefox from
> machine two, I now have merely another Firefox window that
> is "pointing" to machine one (it uses ~userone/.mozilla
> and name resolution from machine one), not machine two
> (from where it was launched.
>
> I'm guessing this is an SSH issue, rather than a Firefox
> issue, but I cannot guess what the issue is.
Actually, I think it is Firefox. I don't understand all the mechanics,
but the command "firefox" is a shell script. And when you invoke it, it
checks for already-running instances of the main executable. Check out
this excerpt from my /opt/mozilla/bin/firefox:
# The following is to check for a currently running instance.
# This is taken almost verbatim from the Mozilla RPM package's launch
# script.
MOZ_CLIENT_PROGRAM="$dist_bin/mozilla-xremote-client"
check_running() {
"${run_moz}" "$MOZ_CLIENT_PROGRAM" -a "${progbase}" 'ping()' \
2>/dev/null >/dev/null
RETURN_VAL=$?
if [ $RETURN_VAL -eq 0 ]; then
echo 1
return 1
else
echo 0
return 0
fi
}
It looks like mozilla-xremote-client is what detects the running
instance. Unfortunately, that's a binary, so we can't easily look inside
it, but I'd guess it is looking for any X client called Firefox.
If I'm right, then this is a non-trivial problem, but I imagine you
could come up with a "firefox" script that would start a new local
instance if the existing instance is remote.
Hmmm ... or here's another thought: if you try to start Firefox locally
when there's already a local instance running, you get (or at least I
do) a dialog saying that Firefox is already running, and asking you to
select a profile. That suggests that there might be a workaround using
profiles ... e.g. each user might have a profile representing a local
instance, and another for remote instances. Just off the top of my head.
--
Matt Gushee
Englewood, CO, USA
More information about the clue-tech
mailing list