LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
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 01-30-2010, 05:04 PM   #1
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 1,032

Rep: Reputation: 174Reputation: 174
Firefox - .parentlock and lock


Can anyone explain what the purposes of the .parentlock file and the lock symbolic link that Firefox uses to indicate when a profile is in use?

Obviously I know they're used to mark that the profile is in use, but only one file is used for the same purpose on Windows (parent.lock) and Mac OS X (.parentlock). So what I want to know is why does Linux use two files and what purpose does each of the files serve?

I've looked and looked and looked some more for this information and the question has gone unanswered (as yet) on the Firefox support forums.
 
Old 01-31-2010, 12:23 PM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
~/.mozilla/firefox/lpih4bes.default/.parentlock

In the windows version, it is called "parent.lock".
This file tells firefox that the profile is already in use, so it is also known as the profile lock file.

Explore Mozillazine
 
Old 01-31-2010, 12:33 PM   #3
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
FWIW, both options can be compiled in or out (on *nix), if you build your own Firefox.

Doesn't really make sense that both "parental controls" (whatever that is) and "profile sharing" (implying that each instance of FF can not use the same profile simultaneously) would use the same lock file. Weird, though I hadn't looked this far into these features.
 
Old 01-31-2010, 02:46 PM   #4
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 1,032

Original Poster
Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by Simon Bridge View Post
In the windows version, it is called "parent.lock".
Yes, I know. As demonstrated by my mentioning this in my original post.

What I want to know is, why is there both a .parentlock file and a symbolic link called lock? Why does Linux use two files to achieve what is done using one file on Windows and Mac OS X?

I know from experience that if one encounters the problem of Firefox claiming that the profile is in use when you know for certain that it isn't, the problem can be cured by deleting .parentlock. (I have seen this problem when no lock file exists.) What puzzles me about this is that .parentlock always seems to exist and is always zero length regardless of whether Firefox is actually running:

With Firefox running:
Code:
mike@continuity:~/.mozilla/firefox/7e7iejk0.default$ ls -l .parentlock 
-rw-r--r-- 1 mike users 0 2010-01-31 18:33 .parentlock
mike@continuity:~/.mozilla/firefox/7e7iejk0.default$ ls -l lock
lrwxrwxrwx 1 mike users 15 2010-01-31 18:33 lock -> 127.0.0.2:+3557
Where 127.0.0.2 is the IP address of the machine the profile is in use on and the 3557 is the process ID of the Firefox process that's using the profile.

With Firefox not running:
Code:
mike@continuity:~/.mozilla/firefox/7e7iejk0.default$ ls -l lock
ls: cannot access lock: No such file or directory
mike@continuity:~/.mozilla/firefox/7e7iejk0.default$ ls -l .parentlock 
-rw-r--r-- 1 mike users 0 2010-01-31 18:33 .parentlock
So what I'm trying to understand is what that .parentlock file actually does.


Quote:
Originally Posted by GrapefruiTgirl View Post
Doesn't really make sense that both "parental controls" (whatever that is) and "profile sharing" (implying that each instance of FF can not use the same profile simultaneously) would use the same lock file. Weird, though I hadn't looked this far into these features.
Where do you get "parental controls" from?
 
Old 01-31-2010, 02:51 PM   #5
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
"parental controls" is a build option that can be enabled or disabled. Here's a snippet from my Firefox build script:

Code:
ac_add_options --disable-mailnews
ac_add_options --disable-parental-controls
ac_add_options --disable-safe-browsing
I have no idea how one 'uses' this option in real life; I have never seen any mention in about:config or in my FF UI about it, so maybe it's usually disabled by default, on standard builds?
 
Old 01-31-2010, 02:55 PM   #6
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: SLED, openSUSE
Posts: 1,032

Original Poster
Rep: Reputation: 174Reputation: 174
Quote:
Originally Posted by GrapefruiTgirl View Post
"parental controls" is a build option that can be enabled or disabled.
OK. What does that have to do with my original question?
 
Old 01-31-2010, 02:58 PM   #7
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550Reputation: 550
Quote:
Can anyone explain what the purposes of the .parentlock file and the lock symbolic link that Firefox uses to indicate when a profile is in use?
The above is from your original question.
IMHO, it is logical to figure that a file called .parentlock and a build option called "Parental Controls" are related, and therefore I tried to provide come context that might help you deduce something about the .parentlock file.

If I was wrong, so be it. Disregard the information

Sasha
 
Old 01-31-2010, 08:13 PM   #8
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
I see I'm not the only one to misunderstand the intent of the original post
Quote:
So what I want to know is why does Linux use two files and what purpose does each of the files serve?
~/.mozilla/firefox/lpih4bes.default/.parentlock
~/.mozilla/firefox/lpih4bes.default/lock -> 127.0.1.1:+22023

Sadly for the Morning Citrus Goddess, it is not normally associated with parental controls. Though that's a reasonable guess. It is called "parent" lock because it locks the parent process.

".parentlock" marks the profile in use

"lock" tells firefox where it is running and which PID it has.

I'm sure I have a simple picture of why this is useful, someplace, I'll go look.

Aside: the both of us answer a lot of these questions, and also have our own things to run. It helps us a great deal if you put the question you actually want answered close to the top of your post (in the first 128 characters, or, best, in the title). Otherwise you will find the first sentence ending in a question-mark gets emphasis.
 
1 members found this post helpful.
Old 02-03-2010, 11:46 PM   #9
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
As promised - I checked: I know GrapefruiTgirl enjoys these details. Its not complete but should point you in the right direction.

Firefox reuses existing sessions in a multi-login environment if possible. The different files are because different OSs handle multi-login somewhat differently.

It's how a new instance tells an already running instance to open a URL that was given on the command line. OSX definitely uses a different procedure for this (OpenDoc events), and I don't know how
windows does it.

From reading the source code, linux grabs a lock with fcntl (on the .mozilla/etc/etc/lock file)and with the "ns-4.x compatible" symlink. OSX tries fcntl first, and only seems to fall back to the symlink if all else fails, and windows just does it's own thing. fcntl will fail to get a lock if the file is on an NFS share, presumably one without nfslock support.

The "ns-4.x compatible" symlink lets the program distinguish between a stale lock file created on the local machine (which can therefore be overwritten), and a lockfile created on a remote machine (which you may not want to overwrite), as it may still be valid.

For those that don't know, if your X environment is set up properly, and you do something like ssh with X forwarding enabled to a remote machine, then try to run firefox there, it'll actually spawn a new copy of your local firefox instance, rather than creating a copy of firefox on the remote machine and forwarding it back to you. Last time I did this it involved an NFS /home, so it's possible that's where it comes from. I would retest but Ubuntu doesn't set things up to do this by default (tcp disabled, etc), and I can't be bothered changing my local config.

I don't know for sure exactly what's supposed to happen if you do have NFS /home but for some reason you can't start a remote session of firefox - there's no provision for per-machine lock files. I guess it bails and causes frustration.

In general, you don't want it to be able to, otherwise the two processes writing to the one profile will stomp on each other and corrupt it. If you're using NFS /home, you use different profiles if you need to do that, and then you swear a lot when it breaks anyway because it's not very reliable over NFS.

Last edited by Simon Bridge; 02-03-2010 at 11:52 PM.
 
  


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
Firefox issues with files and .parentlock. Yaro Linux - Software 1 10-21-2009 11:57 AM
Firefox & Mozilla cause lock-ups on a certain website Imek Linux - Software 2 09-24-2006 03:02 PM
.parentlock not being erased darkarcon2015 Fedora 2 09-19-2006 10:58 PM
Firefox lock and can't resize in FC5! HELP freakonwaves Fedora 1 08-29-2006 03:28 AM
firefox encryption lock icon missing rocksniffer Linux - Software 2 07-23-2005 10:38 AM


All times are GMT -5. The time now is 04:47 AM.

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