LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-22-2010, 03:15 PM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Rep: Reputation: 174Reputation: 174
Question Multiple instances of Firefox issue


Ubuntu 9.10 64 bit
nVidia GeForce GT220 1 GB
latest nVidia restricted drivers
configured for "separate X screens"
2 LCD monitors
Firefox 3.5.8

So here is the issue...

If I initiate Firefox on one monitor, I can open another instance ON THE SAME monitor. If I try to open an instance on the other monitor, which would make more sense, I get the error message "Firefox is already running, but is not responding. To open a new window, you must first close the existing Firefox process, or restart your system."

Can anyone tell me if this is a Firefox issue? or an nVidia driver issue? or just a Linux quirk?

Thanks,

Ken

p.s. A solution or work around would be really nice

p.p.s. I just tried Thunderbird and received the same message.
 
Old 02-22-2010, 03:20 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
At this point, I do not believe that "profile sharing" is the problem; otherwise IIRC firefox will tell you about such a problem when it starts.
However, you may yet discover that profile sharing will lead to (or NOT, depending on its configuration) a problem.

In the meantime, before we deal with a profile-sharing issue that may not exist, try starting the second FF instance (the one that won't start) by using a commandline line so:

Code:
shell$ firefox --no-remote
and that *should* start a new instance of FF regardless of any already-running instance.

If it tells you NOW, that the profile is already in use, you'll need to either change your FF's profile management settings (requires recompilation possibly) or set up a new profile with a different name, for use on the second X server.

Anyhow, try the "--no-remote" option first.

Sasha
 
Old 02-22-2010, 03:23 PM   #3
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
EDIT -- Sorry, that should have only ONE leading dash:

-no-remote

 
Old 02-22-2010, 03:24 PM   #4
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
As noted in a different thread, the problem is profile sharing. The response to "--no-remote" (as well as -no-remote) is: "Firefox is already running, but is not responding. (etc)".
 
Old 02-22-2010, 03:27 PM   #5
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
OK, if what Quakeboy writes affects you here too, then create yourself a new profile (or copy your existing one into a newly named profile folder, and start FF like so:

Code:
shell$ firefox -no-remote -profile <profilename>
where <profilename> is the foldername you made for your new profile.

You can also start firefox profile manager by using the -p (or capital -P) option. I can never remember whether it's a lower or upper P/p

Sasha
 
Old 02-22-2010, 05:10 PM   #6
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
When I try starting Firefox from a terminal on the second monitor I get the message (in the terminal) " GLib-WARNING **: g_set_prgname() called multiple times". I also get he same Firefox message in a dialog window which I described initially. If the problem is sharing the same profile, why can I launch several instances of Firefox on the same monitor - which is the same "X screen" per the nVidia configuration program.

I have tried some other programs.

VMWare player and Workstation - can call instance on each monitor - no prolem
OpenOffice.org programs - multiple instances all land on the same monitor as the first instance - regardless of which panel I start them from
gedit, terminal, disk usage analyzer, Gnome Commander - no problem
VLC Player - can play two different movies at once - one on each display
System monitor - can only call up one instance anywhere, same for Synaptic
Man Menu preferences - can call up multiple instances on both monitors

So it looks like some apps, for example Synaptic, can only be instantiated once. (I expect this from Synaptic and Update manager.) Others such as terminal, gedit etc. many times. And some such as Mozilla and OpenOffice.org apps seem to behave differently depending on the screen where they were first instantiated.

What that means??? I know the nVidia drivers are a little screwed up - If I create a document on the screen of the second monitor the file is created at ~/Desktop however, it is not visible on either of the desktops until I logout and login (or otherwise restart X).

If I create a launcher on the second screen/monitor it appears on the first screen/monitor.

Ken
 
Old 02-22-2010, 05:20 PM   #7
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
You say that you can easily start "multiple instances" of firefox on the first monitor, without trouble. Are you SURE that these are actually real multiple instances? Or, are they just multiple WINDOWS of firefox, and actually descended from the same parent instance?

Indeed, some apps can only be running in ONE instance; synaptic sounds like it would logically be one such app. I believe (IIRC) Slackware's package manager (or maybe it was Slackpkg) is like that-- and it makes sense. We don't want two instances of a package manager fighting over what's getting installed or removed at a given time.
But I can attest that Firefox is NOT one such app -- it can run separate instances just fine. The problem here seems to have to do with the DISPLAY though, and I'm not sure why..


Are you setting the $DISPLAY variable to reflect the second X display where you intend for the new FF to appear, prior to giving the command to start?

Sasha
 
Old 02-22-2010, 05:36 PM   #8
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
This is only idle speculatlon:

Firefox opens a number of parameter files, such as bookmarks and config. It wouldn't do for these files to get out of sync with the Firefox that is running. One way to do this is to simply lock the files to a single running instance. Another way is to monitor the files and update the Firefox display as they change. The second way is a potential nightmare as links and features could change and prevent a user from having a sanely behaving browser. So, I speculate that Mozilla chooses the first way, since it is easier to implement.
 
Old 02-22-2010, 05:47 PM   #9
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Excellent question Sasha - I checked my running processes and only find ONE Firefox even though it APPEARS that two separate browsers are running. So I would be happy if the second Firefox WINDOW would appear where I want it.

I have not delved so deeply as to set the $DISPLAY variable - I have simply attempted to launch second "instances" or "windows" of the desired apps from the panel on each monitor.

I have verified that my left monitor is $DISPLAY = :0.0 and the right one is $DISPLAY = :0.1 by doing "echo $DISPLAY" in a terminal on each monitor. This corresponds to the nVidia display driver GUI. I tried launching my second Firfox window from a terminial on the right monitor which has the :0.1 display variable. It did not work as I described above.

How do I launch an app and specify the display where I want it to appear? I did not find anything in a couple of google searches.

Thanks,

Ken
 
Old 02-22-2010, 05:55 PM   #10
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
OK, this is where I get a tad confused WRT which screen/display/monitor corresponds to which, as far as the X server(s) and nvidia driver is concerned.

To my understanding: if you are running two separate X displays but only one X server, then the 0.0 and 0.1 is correct.
However, when running two separate X servers (one per display) then the variables would be 0.0 and 1.0

So, without further confusion, what happens if you try starting a new INSTANCE, using the following command:

shell$ DISPLAY=:0.1 firefox -no-remote -profile <some-other-profile>

Does that work as expected?

If not, then you may be somewhat stuck, for at least two reasons:

--Your window manager may have no way of telling one instance from another, because Firefox not only does not adhere to standards of how applications are supposed to report to the WM, but *may* not provide a way for the user to tell FF to start itself with a different name.

--Firefox may ignore the sub-display variable (the .1) and simply start itself where it pleases, which appears to be "Display 0" and that's that.
 
Old 02-22-2010, 05:57 PM   #11
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
MORE:

I do find it weird that you cannot start the second instance on your second display, since it works for me just fine if I launch it from a terminal on whatever monitor, it starts on THAT monitor; However, I am using nVidia + Xinerama, which may account for something...
 
Old 02-22-2010, 08:35 PM   #12
Quakeboy02
Senior Member
 
Registered: Nov 2006
Distribution: Debian Linux 11 (Bullseye)
Posts: 3,407

Rep: Reputation: 141Reputation: 141
N.B. I'm not the OP, but I do have two displays. Here is the command that I use to bring up firefox on the second display. Yes, I have firefox in a different place than you might expect, but that's not germane to the thread.
Code:
/usr/lib/firefox.3.5/firefox -P Screen2
Added:
OOPS, I should have noted that I have a menu item on the top of my second display; so that makes the association to the correct display when it's run. I also just discovered that I can run that command from a terminal that was opened on the second display and that works. too.

Last edited by Quakeboy02; 02-22-2010 at 08:39 PM.
 
Old 02-23-2010, 07:38 AM   #13
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
Thanks Sasha, however, I get the same error
Quote:
(firefox:12680): GLib-WARNING **: g_set_prgname() called multiple times
so it looks like separate _instances_ are not possible. Fortunately through the magic of much computing horsepower I can run a VM on the right display, load Firefox and look at the instructions for creating a separate profile (which requires Firefox to be shut down) so that I could do the test you recommended.

I don't think I have separate X servers. If I did, that might solve the problem (and cause others?). I am not using Xinerama. I had tried that earlier but decided that I liked the separate screens - with their own panels - for some reason.

As to the solution... Quakeboy02 nailed it! I still get the "called multiple times error - in fact I get it 3 times. However, Firefox opens on the second screen. I have to select a different profile so that Firefox will not step on itself. Still, I can live with that. I will make a copy of my various profile bits and pieces to a separate directory and reference them in the second profile. That way I will have my bookmarks etc. handy. I will add a refresh of the file to my nightly backup routine.

And, for what it is worth... This is actually a second INSTANCE of Firefox - has its own PID.

Thanks all,

Ken

Last edited by taylorkh; 02-23-2010 at 07:49 AM. Reason: typo
 
Old 02-23-2010, 08:05 AM   #14
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 2,127

Original Poster
Rep: Reputation: 174Reputation: 174
So to wrap it all up...

On my left screen panel I have set the Firefox launcher to
Quote:
firefox -P "default"
This brings my my current Firefox environment - most recent bookmarks etc.

On my right screen panel I have set the Firefox launcher to
Quote:
firefox -P "yesterday" -screen2
The profile "yesterday" points to a copy of my current profile which I copy to a second drive each evening as part of my cleanup/backup process.

I can now launch Firefox on both screens simultaneously and my second copy of Firefox is almost current as far as bookmarks etc. Close enough!

Ken
 
Old 02-23-2010, 09:35 AM   #15
Skaperen
Senior Member
 
Registered: May 2009
Location: center of singularity
Distribution: Xubuntu, Ubuntu, Slackware, Amazon Linux, OpenBSD, LFS (on Sparc_32 and i386)
Posts: 2,684
Blog Entries: 31

Rep: Reputation: 176Reputation: 176
Firefox is definitely a program where multiple instances can have an impact. Fortunately, that impact is only in those instances sharing files it keeps for itself, such as the cache, bookmarks, etc. The profiles feature was intended to isolate those things, much like separate users, so that truly separate processes would not step on each other via unmanaged file sharing (that tends to complicate things, and apparently is not included in Firefox).

However, I have found glitches and problems with profiles. I worked around that by using fake home directories and setting the HOME environment variable separately. You can do this two ways. One is to set up a few static fake home directories. The other is to create them dynamically as needed. I did the latter, and create them from a template tarball. I then tied that in to everything that starts Firefox, so each time I start Firefox, I get a fresh new process instance. That way client-side scripts from one web site can't make cross site accesses to other web sites that I'm already logged in to (e.g. Gmail) ... because from the Firefox instance they are using, I'm NOT logged in.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefox terminates if multiple instances of flash player running mutav Slackware 2 02-17-2010 01:55 PM
multiple instances of firefox? nataloi Linux - Newbie 1 04-22-2009 01:24 PM
Multiple Instances of MySQL neoform Linux - Server 8 04-12-2009 10:43 AM
Multiple instances tekmann33 Linux - Newbie 1 01-28-2008 03:05 PM
kickstart; how-to info needed for multiple instances of RH OS's and multiple unique v Joe_Wulf Linux - Server 4 06-21-2007 11:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration