Re: [Exim] 4.10 exiwhat causing panic - Cannot open process …

Góra strony
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
Dla: Richard.Hall
CC: exim-users
Temat: Re: [Exim] 4.10 exiwhat causing panic - Cannot open process log file
On Tue, 29 Oct 2002, Richard.Hall wrote:

> 2002-10-17 22:21:18 Cannot open process log file
> "/var/spool/exim/spool/exim-process.info":


Haven't seen that before, but it looks similar to an outstanding problem
with hints files that I've never been a ablt to track down, despite many
tests, investigations, etc.

> My _guess_ is that there is some sort of timing/race problem between
> different exim processes trying to create and/or open the file.


Sounds plausible.

A way round this would be to change exiwhat so that it empties the file
at the start, instead of removing it. Thus, once it is created, it won't
go away.

> I've
> stared at open_log() in log.c, and it seems theoretically possible that
> one process with euid=root could create and own the file, and another
> process with euid=exim could fail as above before root has time to
> chown/chmod the file. However, I don't know enough to know if the
> conditions for this could actually happen in practice.


Yes, it is possible. I wonder whether a way round this would be to
proceed as follows:

1. Create the file world-writeable.
2. Change its ownership to exim:exim.
3. Change its permissions.

Thus, if another process tried to access it between 1 and 2, it would
succeed. Maybe an alternative would be to change group to exim and
create it group-writeable.

The alternative is to fork a new process, and change to exim:exim before
creating the file. But that seems rather expensive. On the other hand,
log files are not created very often (especially if I modify exiwhat as
well).

--
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.