httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Richards <p.richa...@elsevier.co.uk>
Subject Re: New httpd_monitor diffs
Date Thu, 21 Dec 1995 20:28:29 GMT
In reply to Ben Laurie who said
> 
> The usual scheme used by mktemp is that it generates abcd.X12345 where 12345
> is your PID and X is a carefully chosen character which makes the name unique.
> There is no generally reliable way to deduce the temporary file name, the only
> way to be accurate is to get the server to tell you. Or, use a better scheme
> for generating the temp file name (for example, port number+host address is
> unique, and can be determined externally). Best of all would be to have it
> somewhere in the conf/logs area.


I agree, I think mktemp is a completely bogus thing to do here since it's
intent is to allow the creation of temporary, anonymous files within a
process. The scoreboard file hardly fits that category since it exists
for the whole life of the process and the only requirement is that it
is unique to as single server. It's also usefull to be able to know
the filename externally for things like http_monitor to work.

Also, there's absolutely nothing stated anywhere that says mktemp uses
the PID to create unique strings. It just so happens that many
implementations do but as has already been show, the way in which they
do so is highly implementation dependant.

There's a straightforward way to create files that are unique to
single processes (as opposed to unique within a process), and that's to
use the PID of the creating process in the filename. What is wrong
with htstatus.PID ?

That aside, there should still be a config option to nail the 
scoreboard name to a particular filename or a particular path.

I also tend to dislike binary files. It's a fairly standard unix
practice to use text for log/status files so you can read them
easily. I don't see any overriding reason not to do the same with the
scoreboard file.

-- 
  Paul Richards. Originative Solutions Ltd.
  Internet: paul@netcraft.co.uk, http://www.netcraft.co.uk
  Phone: 0370 462071 (Mobile), +44 1225 447500 (work)

Mime
View raw message