LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 06-15-2011, 03:10 PM   #1
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Rep: Reputation: 115Reputation: 115
starting Firefox in a separate process


In an older version of Firefox, it would enough to be running in a separate home directory for a launch of Firefox to run in a separate process. Now the Firefox developers are getting craftier in trying to prevent users from doing this. A separate userid still works, but that's too messy to work with dynamically (e.g. requires running as root to do it). So that's to be avoided.

What happens is that the new instance of Firefox just communicates with the old instance and tells the old instance to open a window, and just exits. What I really want to happen is for the new instance to stay and work on its own, and in its own directory. It's kind of like profiles, but even more separated. All that is needed is to defeat that "feature" where it tells an already running process to do the work.
 
Old 06-16-2011, 04:58 AM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Why do you have to run as root ?

I have 2 users, smoker and test.

When logged in as smoker, I open a terminal and use
Code:
su - test
I supply test's password and then start firefox from the terminal.
No root involved. (technically su is still running as root, but not the firefox process under test)

Code:
[smoker@smoker-PC ~]# ps -u test
  PID TTY          TIME CMD
 7447 ?        00:00:00 dbus-launch
 7448 ?        00:00:00 dbus-daemon
 7535 pts/0    00:00:00 bash
 7553 pts/0    00:00:00 xdg-open
 7565 pts/0    00:00:03 firefox
 7595 ?        00:00:00 gconfd-2
[smoker@smoker-PC ~]#

Last edited by smoker; 06-16-2011 at 05:03 AM.
 
Old 06-16-2011, 07:24 AM   #3
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Original Poster
Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by smoker View Post
Why do you have to run as root ?
This for the method of creating a new user on the fly, root is needed to add the new user to /etc/passwd and such.

Quote:
Originally Posted by smoker;4387348I have 2 users, smoker and test.

When logged in as smoker, I open a terminal and use
[code
su - test
[/code]

I supply test's password and then start firefox from the terminal.
No root involved. (technically su is still running as root, but not the firefox process under test)

Code:
[smoker@smoker-PC ~]# ps -u test
  PID TTY          TIME CMD
 7447 ?        00:00:00 dbus-launch
 7448 ?        00:00:00 dbus-daemon
 7535 pts/0    00:00:00 bash
 7553 pts/0    00:00:00 xdg-open
 7565 pts/0    00:00:03 firefox
 7595 ?        00:00:00 gconfd-2
[smoker@smoker-PC ~]#
Automate this so it works through graphical icons w/o putting up a prompt.

So how about focusing on the original question now that you took this thread out of the zero reply list.
 
Old 06-16-2011, 07:50 AM   #4
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
I suggest you contact the firefox developers then, as whatever solution you find is going to be a hack. I gave you an answer, you didn't like it. That's your problem.
I don't see why you need to have separate processes anyway, you didn't describe that part.

But you can't deny that the answer I gave you works as specified.

And don't start with that zero reply crap again. This site is full of zero reply threads because no one has the guts to post a response to blue sky wish fulfilment requests.
 
Old 06-16-2011, 07:51 AM   #5
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948
FF has always had the -no-remote option to tell it not connect to an already running instance. You do need to have a separate profile to run the new instance as, however, as only one process can safely use a profile at a time.

It's all right there in the man page.
 
1 members found this post helpful.
Old 06-16-2011, 10:50 AM   #6
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Original Poster
Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by David the H. View Post
FF has always had the -no-remote option to tell it not connect to an already running instance. You do need to have a separate profile to run the new instance as, however, as only one process can safely use a profile at a time.

It's all right there in the man page.
In the past, FF would not try to do this if the context where the profiles are stored is different. Being in a different home directory was sufficient, as determined by the HOME environment variable. That seems to have changed, now. Either they use the home directory in the /etc/passwd file, or ignore it entirely.

I just tried -no-remote and that does work. But there is no man page. I've never seen one installed for the man command to use. I did just now find one online via Google, but it doesn't have a -no-remote option. It is for an older version in which the "different home" method works. Other search hits are for lots of bug reports that generally mention man pages. But none describe the man page as missing.

http://manpages.unixforum.co.uk/man-...-man-page.html

Anyway, this is a solved thread. Should I start another one for why the man page is missing? Maybe that's distro specific (Slackware and Ubuntu here)?
 
Old 06-16-2011, 10:57 AM   #7
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Original Poster
Rep: Reputation: 115Reputation: 115
There is no "Mark this thread as solved" option on this thread (but another I started does have it). And there are threads in "Linux - Desktop" with "[SOLVED]" so it appears this should work in this forum.
 
Old 06-16-2011, 11:04 AM   #8
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Hanover, Germany
Distribution: Main: Gentoo Others: What fits the task
Posts: 15,592
Blog Entries: 2

Rep: Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047Reputation: 4047
I also have no man-page for Firefox on Slackware, but a
Code:
firefox --help
shows that option.
 
Old 06-16-2011, 11:05 AM   #9
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 1,022

Rep: Reputation: 173Reputation: 173
It's not clear exactly you're trying to achieve but I'm wondering if the -CreateProfile and -P options might be the solution.
E.g. the following will launch Firefox with the existing profile, then create a new profile and launch Firefox with that


Code:
mike@mike-VirtualBox:~$ firefox & disown
mike@mike-VirtualBox:~$ firefox -CreateProfile bob
Success: created profile 'bob' at '/home/mike/.mozilla/firefox/5bqo51e4.bob/prefs.js'
mike@mike-VirtualBox:~$ firefox -P bob
Now you have Firefox running twice as the same user using two different profiles.


If I type 'man firefox' in Ubuntu 11.04 I get a Firefox man page. It's provided by the same package as /usr/bin/firefox It doesn't mention the CreateProfile option though, I happened to know that existed. All options can be seen at http://kb.mozillazine.org/Command_line_arguments
 
Old 06-16-2011, 11:15 AM   #10
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Original Poster
Rep: Reputation: 115Reputation: 115
I don't get a man page in Ubuntu 10.10 or Slackware64 13.37.

The profiles might be usable for a lot of things. But I will be managing them as directories in ways that involve not having them all where Firefox wants to put them. The way Firefox generates random characters as part of the profile directory complicates how I want to manage it. The way I've been doing it for years has worked until they changed how it decides whether or not to use remote. I've been looking at more stuff now that I know they use the terminology "remote" for this (I was just looking for "separate process" and not finding much), and there seems to be an odd history of things going on.
 
Old 06-16-2011, 12:14 PM   #11
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Original Poster
Rep: Reputation: 115Reputation: 115
Here's another problem, why profiles are not adequate. The directory for plugins is outside of a profile. So if one profile has a plugin, all the others do, too. Change the HOME directory and you have a different context of plugins.
 
Old 06-16-2011, 01:55 PM   #12
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 1,022

Rep: Reputation: 173Reputation: 173
Creating Firefox profiles in a specified location:

Code:
mike@mike-VirtualBox:~$ ls -l /tmp/ffprofiles
ls: cannot access /tmp/ffprofiles: No such file or directory
mike@mike-VirtualBox:~$ firefox -CreateProfile "ringo /tmp/ffprofiles/ringo"
Success: created profile 'ringo /tmp/ffprofiles/ringo' at '/tmp/ffprofiles/ringo/prefs.js'
mike@mike-VirtualBox:~$ ls -l /tmp/ffprofiles
total 4
drwx------ 2 mike mike 4096 2011-06-16 18:35 ringo
mike@mike-VirtualBox:~$ ls -l /tmp/ffprofiles/ringo/
total 0
-rw-r--r-- 1 mike mike 0 2011-06-16 18:35 prefs.js
mike@mike-VirtualBox:~$ tail -5 ~/.mozilla/firefox/profiles.ini 
[Profile6]
Name=ringo
IsRelative=0
Path=/tmp/ffprofiles/ringo

mike@mike-VirtualBox:~$

I don't think I understand the plugins problem. I'm aware there can be a plugin directory in ~/.mozilla though I forget exactly where and don't know if it's still used so changing the home directory, and (presumably) hence the user Firefox is running as will mean that directory is unique to each instance of Firefox. However there's usually (always?) a global plugin directory somewhere, e.g. Ubuntu has /usr/lib/mozilla/plugins, SUSE has /usr/lib/browser-plugins, and changing the home isn't going to change the visibility of the plugins in there.

I thought I'd seen something in the past about changing/specifying plugin directories but can't find it now. On SUSE the script which starts firefox sets a variable called MOZ_PLUGIN_PATH but that doesn't see to have any effect in Ubuntu.
 
Old 06-16-2011, 03:07 PM   #13
Skaperen
Senior Member
 
Registered: May 2009
Location: WV, USA
Distribution: Slackware, CentOS, Ubuntu, Fedora, Timesys, Linux From Scratch
Posts: 1,777
Blog Entries: 20

Original Poster
Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by arizonagroovejet View Post
I don't think I understand the plugins problem. I'm aware there can be a plugin directory in ~/.mozilla though I forget exactly where and don't know if it's still used so changing the home directory, and (presumably) hence the user Firefox is running as will mean that directory is unique to each instance of Firefox. However there's usually (always?) a global plugin directory somewhere, e.g. Ubuntu has /usr/lib/mozilla/plugins, SUSE has /usr/lib/browser-plugins, and changing the home isn't going to change the visibility of the plugins in there.

I thought I'd seen something in the past about changing/specifying plugin directories but can't find it now. On SUSE the script which starts firefox sets a variable called MOZ_PLUGIN_PATH but that doesn't see to have any effect in Ubuntu.
Yes, there is a global plugin directory. That's where most plugins generally go, at least when installed by the system administrator for all users. Until I got all this stuff I have been doing on Slackware (based on fake home directories) to work on Ubuntu, I had to use REAL userids to differentiate plugins. For example one user does not have the Flash plugin, while another does. I have to switch users to go between Flash and safe. With this fake home directory scheme now working, I can just click a different icon (which runs the script that sorts it out based on arguments in the icon launcher properties).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
MySQL & HTTP process allocation to separate processors on server kultechi Linux - Server 1 09-29-2010 09:54 AM
LXer: Firefox 3.6 is getting plugins running as a separate process LXer Syndicated Linux News 0 04-09-2010 10:50 AM
Firefox windows on separate X displays CoderMan Linux - Desktop 6 02-20-2010 12:19 PM
get the PID of a separate process (no parent-child relationship) arunj Linux - Software 6 02-03-2006 01:50 AM
starting separate syslog for chroot environment plan9 Linux - Security 3 08-09-2004 05:57 PM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration