harrison@utfyzx.UUCP (12/02/87)
The environment: HP9000S500 running HP-UX Release 5.11 (UNIX V.2).
The problem: When lp (1) receives two jobs nearly simultaneously
it doesn't print one, leaving it queued in /usr/spool/lp/request/
until I cancel it. Jobs submitted after usually print, but ..
Sometimes in these circumstances it assigns the same id number
to two jobs, which then issues an error to one of them. When
this happens the spooler croaks, piling up jobs in the request
directory until I do a disable/enable cycle.
Theory of cause: Lp ignores the System V IPC available to it
and relies on lockfiles in /usr/spool/lp. The window of time
between checking for the (non)existence of the lockfile and trying
to create it is the window through which the bugs crawl.
Theory of fix: Surround lp with an onionskin that uses semaphores
(semget(), semctl() etc.) to lock and unlock the process.
Any further thought on this problem or (better) code implementing
a fix would be greatly appreciated. Thus bug is biting me weekly
but not weakly.
--
David Harrison, Dept. of Physics, Univ. of Toronto
{ihnp4,utzoo}!utgpu!utfyzx!harrison