OF filters question : 4.2BSD LP Spooler
James P. Kiely
kiely at lownlab.UUCP
Fri Mar 14 10:41:30 AEST 1986
In the "4.2BSD Line Printer Spooler Manual" it states that "The
output filter of is ... started only once ... [with] no provi-
sion ... [for] identifying the beginning and end of jobs ... ".
I originally thought that this meant that OF was started up once
for the entire duration of the life of the lpd Master Daemon.
But as far as I can tell from the sources (specifically
printjob.c) OF is started (in the routine openpr) each time the
print queue starts up, i.e. each time the print queue was
empty and now has something to print. This is the only time the
OF filter is started. It is not restarted for every job. For
instance, if there are five jobs in the queue at the same time,
they will all be processed by the same OF filter process.
Therefore the OF filter should not exit upon seeing EOF on the
input.
The question is: how does OF know when to exit?
The only time it receives a signal other than SIGCONT is during
abortpr() which is only called if printjob() receives a signal.
Under normal printing conditions, printjob() simply exit's(0) if
there is no more work to do. The IF filter is started for each
job and is waited for and as such does not have this problem.
Therefore, one can avoid the OF exiting problem by using IF and
not OF as long as the banner page does not have to go through a
filter. But I would like to run the banner page through a filter
and I would also like to know the correct solution to this prob-
lem.
Please respond directly to me by email. I will summarize the
responses to the net. If I am doing something stupid, please be
kind; after all I was raised on hardware.
--
NAME: James P. Kiely USPS: Lown Cardiovascular Laboratory
USENET: ...!harvard!lownlab!kiely Harvard School of Public Health
PHONE: +1 617 732 1307 665 Huntington Avenue
Boston, MA 02115-9915
More information about the Comp.bugs.4bsd.ucb-fixes
mailing list