This is really really interesting.

When sending a job to a printer,  the LPD server will:

a) open a connection (FD = xxx)
b) fork a server process to be the filter
c)   dup the connection FD = xxx to be STDOUT (FD = 1)
d)   exec the filter
e) wait for filter to complete
f) repeat b,c,d,e until all files are sent

Now here is the neat part.  If the connection is a socket
 AND the filter puts the socket in NONBLOCKING mode
 THEN all operations by other processes become nonblocking.
   ... This depends
    a)  OS
    b)  VERSION of OS
    c)  Type of connection (socket/io device)

Now it turns out that some OS's implement pipes as (effectively)
sockets,  and some as 'real devices'.  So this means that STRANGE
things can happen.  Cool...  And there is virtually no way that
you can determine the particuar behavour using configure without
writing TCMFH (The Configure Macro From Hell).

In the next/latest release of LPRng the LPD server will
reset ALL passed FD's to filters into NONBLOCKING mode
and then when the subprocesses exit,  reset them to NONBLOCKING
mode.  This seems to solve the problem of the mystery
'run away process'.

Thanks to the folks at BSDCON 2002 who thought about this
and suggested a possible cause of the problem.

Patrick Powell                 Astart Technologies,
[EMAIL PROTECTED]            9475 Chesapeake Drive, Suite D,
Network and System             San Diego, CA 92123
  Consulting                   858-874-6543 FAX 858-279-8424 
LPRng - Print Spooler (http://www.lprng.com)

-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address

If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body.  For the impatient,
to subscribe to a list with name LIST,  send mail to [EMAIL PROTECTED]
with:                           | example:
subscribe LIST <mailaddr>       |  subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr>     |  unsubscribe lprng [EMAIL PROTECTED]

If you have major problems,  send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------

Reply via email to