Mailing List Archive

scoreboard in /tmp
There's a very long bug report in the bugs mail from a guy who
fired up Apache on a system without a /tmp directory.

The results were disasterous.. 150 children created and server meltdown.

Fortunately he was testing Apache, and not running it as a main server.


rob
--
http://nqcd.lanl.gov/~hartill/
Re: scoreboard in /tmp [ In reply to ]
No /tmp? Nasty....

On the other hand, not everyone has a writable ServerRoot/logs directory
either; there are probably quite a few people who just explicitly set

TransferLog /usr/admin/logs/...
ErrorLog /usr/admin/logs/...

where ServerRoot is somewhere else, who don't have ServerRoot/logs writable
(it may not even exist), and when we move the scoreboard there, those people
will be screwed.

I guess the important thing is that the error handling for this case ought
to be better...

rst
Re: scoreboard in /tmp [ In reply to ]
In reply to David Robinson who said
>
> The correct fix for the location of the scoreboard is to have
> a TmpDir directive.

Well, a ScoreBoardDir perhaps. I think I'd want the scoreboard somewhere
more secure.

--
Paul Richards, Bluebird Computer Systems. FreeBSD core team member.
Internet: paul@FreeBSD.org, http://www.freebsd.org/~paul
Phone: 0370 462071 (Mobile), +44 1222 457651 (home)
Re: scoreboard in /tmp [ In reply to ]
Also on the scoreboard tip - can we have apache try and unlink the old /tmp
file when it gets a HUP signal and starts a new one? If that can be done
for kills and -15 and segv's that would be great too.

Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com brian@hyperreal.com http://www.[hyperreal,organic].com/
Re: scoreboard in /tmp [ In reply to ]
>From: Rob Hartill <hartill@ooo.lanl.gov>
>Date: Mon, 7 Aug 95 17:27:39 MDT
>X-Marks-The-Spot: Doh !
>
>There's a very long bug report in the bugs mail from a guy who
>fired up Apache on a system without a /tmp directory.
>
>The results were disasterous.. 150 children created and server meltdown.
>
>Fortunately he was testing Apache, and not running it as a main server.

A patch follows fixing the bugs in the error checking; it wasn't
testing popenf or mktemp returns correctly.

The correct fix for the location of the scoreboard is to have
a TmpDir directive.

David.

--------------------- begin file score.patch -------------------------
*** http_main.c~ Fri Aug 4 01:00:05 1995
--- http_main.c Tue Aug 8 11:29:59 1995
***************
*** 324,330 ****

void reinit_scoreboard (pool *p)
{
! if (!have_scoreboard_fname && !mktemp(scoreboard_fname)) {
fprintf (stderr, "Cannot assign name to scoreboard file!\n");
exit (1);
}
--- 324,331 ----

void reinit_scoreboard (pool *p)
{
! if (!have_scoreboard_fname && (mktemp(scoreboard_fname) == NULL ||
! scoreboard_fname[0] == '\0')) {
fprintf (stderr, "Cannot assign name to scoreboard file!\n");
exit (1);
}
***************
*** 331,337 ****

have_scoreboard_fname = 1;

! if (!(scoreboard_fd = popenf(p, scoreboard_fname, O_CREAT|O_RDWR, 0644))) {
fprintf (stderr, "Cannot open scoreboard file:\n");
perror (scoreboard_fname);
exit (1);
--- 332,340 ----

have_scoreboard_fname = 1;

! scoreboard_fd = popenf(p, scoreboard_fname, O_CREAT|O_RDWR, 0644);
! if (scoreboard_fd == -1)
! {
fprintf (stderr, "Cannot open scoreboard file:\n");
perror (scoreboard_fname);
exit (1);
***************
*** 346,352 ****
{
if (scoreboard_fd != -1) pclosef (p, scoreboard_fd);

! if (!(scoreboard_fd = popenf(p, scoreboard_fname, O_CREAT|O_RDWR, 0666))) {
fprintf (stderr, "Cannot open scoreboard file:\n");
perror (scoreboard_fname);
exit (1);
--- 349,357 ----
{
if (scoreboard_fd != -1) pclosef (p, scoreboard_fd);

! scoreboard_fd = popenf(p, scoreboard_fname, O_CREAT|O_RDWR, 0666);
! if (scoreboard_fd == -1)
! {
fprintf (stderr, "Cannot open scoreboard file:\n");
perror (scoreboard_fname);
exit (1);
--------------------- end file score.patch -------------------------
Re: scoreboard in /tmp [ In reply to ]
drtr:

[cool patch stuff deleted]

> The correct fix for the location of the scoreboard is to have
> a TmpDir directive.

Mmm, except that it isn't going to be a 'temporary' resource. Sometime
soon we'll be writing httop, htps and other stuff that will let us
keep track of what's breaking. If we could dispense entirely with the
need for /tmp files that would be nice.

Mmm, have you noticed that way that accidently running a new httpd
will trash the entry in logs/httpd.pid, thereby stuffing all the rotation
and sig -HUP scripts that rely on the file.

Mmm, gunna have to find a new way to start sentences.

Ay.
Re: scoreboard in /tmp [ In reply to ]
It already tries to do the unlink for kill -15s --- I'm not sure whether
it would be the right thing for SEGV's. (You'd have to be careful to make
sure that that unlink() stays out of code which might be executed by one
of the child processes).

rst