[OpenAFS] Daemon logging to AFS-mounted logfile

Tino Schwarze tino.schwarze@informatik.tu-chemnitz.de
Mon, 15 Jul 2002 23:19:11 +0200


On Mon, Jul 15, 2002 at 04:48:17PM -0400, Sven wrote:

> In trying to create a distributed file system to emulate clustering
> (this will cluster a series of web servers together), I have come
> across a problem in logging to a file that exists in the AFS space.
> Using Solaris 9 and AFS compiled from the 2002-07-05 snapshot, I have
> mounted the apache data, conf, and logging directories into a
> RW-mounted directory. A total of 4 servers are currently being used in
> our test setup. The problem is that when Server 2, for example, is
> started, it opens a pipe to the log file; any writes to the logfile
> are not "propogated" or released until the daemon is stopped
> (effectively closing the data pipe). At that point, the log file is
> visible in its entirety on the other servers.

This is exactly one issue where AFS violates the Unix file system
semantics. It's called write-on-close. You can also force the log file
to show up by calling fsync() frequently.

See "AFS Implements Save on Close" at
http://www.openafs.org/pages/doc/frameless/AdminGuide/auagd007.htm

> Is there a workaround for this, or am I limited to only having webpage
> updates propogate throughout the system? These will be frontpage sites
> so the file writing will be done by "nobody" or the apache daemon user
> which I assume will not function in the same manner as logging. 

You might be able to use mod_auth_pam (I don't know the frontpage stuff)
and have the server acquire a token on behalf of the user using
PAM_SetCred.

HTH! Tino.

-- 
             * LINUX - Where do you want to be tomorrow? *
                  http://www.tu-chemnitz.de/linux/tag/