[pmwiki-users] .flock troubles

Patrick R. Michaud pmichaud at pobox.com
Thu Apr 21 15:33:26 CDT 2005


On Thu, Apr 21, 2005 at 10:04:42PM +0200, Joachim Durchholz wrote:
> Hi all,
> 
> I just hit a stale .flock issue again. Just adding another data point to 
> that nagging problem - hopefully a solution can be found in the end!

What version of pmwiki?  Newer versions (since beta30) should
have *much* better .flock handling, and don't "hang" when a stale
.flock occurs.  Note that all 2.0 versions prior to beta30 have the 
potential for deadlocking because of the way PHP handles sessions,
and this problem became acute in beta28 and beta29 with the new
authorization functions.

> Some additional observations:
> 
> 1. The last change was done at 17:20, as checking .lastmod and 
> Main.AllRecentChanges revealed (that was confirmed by ll -t, which 
> showed that these were indeed the last files changed). However, as can 
> be seen above, the .flock file was last created/changed far later.

That shows the last time a page was saved, but not necessarily
the last time that someone requested an edit (which also acquires
an exclusive lock on .flock).

> 2. Somehow, the .flock file got created with the wrong user. I don't 
> know how this ever might have happened. I've got even less of a clue why 
> this should be a problem - any process in group www should be able to 
> remove or touch that file, since both the file and the wiki.d directory 
> are in group www and group writable.

I don't know either.  This commonly happens when a .flock is copied from
another wiki.d/ directory, either as part of a backup or restore.
It can also happen if the apache administrators mucks temporarily
with the User/Group settings in Apache, or if an overeager sysadmin 
thinks it's useful to fix file ownerships with 
"chown -R someuser ~someuser".

Regardless, PmWiki felt that the .flock file was sufficiently writable,
otherwise it would've removed .flock and recreated it rather
than blocking entirely.  

> 3. There was a strange file called NOOP in wiki.d/ . That's probably 
> unrelated, because it is already a week old, but I'm not sure how such a 
> file might have been created. (It contained a wiki page, but one that 
> wasn't named NOOP. Actually, NOOP isn't a valid name for a wiki page file.)

This makes me suspect that some other system process is creating
files in your wiki.d/ .  You're right that NOOP isn't a valid wiki page
filename.

Pm



More information about the pmwiki-users mailing list