[geeks] Need expert opinion

Charles Shannon Hendrix shannon at widomaker.com
Tue Oct 5 13:32:26 CDT 2004


Mon, 04 Oct 2004 @ 11:27 -0400, velociraptor said:

> Anyone have any idea what might happen if two processes tried to 
> HUP the same pid at the same time?

Have you tried sending it two signals and watching to see what happens?

> I had a situation where two scheduled cron processes were trying to
> HUP the same httpd when rolling the logs.  The cron entries were
> for the same times.  :-/

The short answer is that on a modern UNIX system and assuming the httpd
server is written properly, it should have no effect.

The long answer is: it depends on how the httpd server was written and
which OS it is running on.

Background:

Reliable signals didn't arrive until 4.2BSD and SysVR3 UNIX, which
implemented them differently.  POSIX went with BSD.

BSD implemented automatic system call restart, and automatic signal
restart, even with the old signal() call.  By contrast, SysV only does
automatic system call restart if you ask for it, and only resets signal
handlers automatically if you use the newer signal functions.

If you are running Apache, I'm pretty sure it does the right thing
regardless of which signal semantics are present.




-- 
shannon "AT" widomaker.com -- ["That which is overdesigned, too highly
specific, anticipates outcome; the anticipation of outcome garantees, if
not failure, the absence of grace." -- William Gibson, All Tomorrow's
Parties]



More information about the geeks mailing list