Serial Printer Problem (fixing the scheduler problem)

Jonathan Bayer jbayer at ispi.COM
Fri Jul 20 21:50:09 AEST 1990


aryeh at eddie.mit.edu (Aryeh M. Weiss) writes:

>In article <2070 at lakesys.lakesys.com> davef at lakesys.UUCP (Dave Fenske) writes:
>>Has anyone ever encountered a Xenix problem in which the print spooler
>>hangs when a print job is cancelled.   This occurs on a serial port, BTW.
>>

>Yes, this seems to happen when you cancel the job at the top of the queue
>(the job that is currently printing).  Canceling a job lower down on the
>queue works okay.  Usually the result is `lpsched' dies leaving some
>child processes behind.  Starting the
>scheduler up again then usually fixes the problem.  I ended up writing a fake
>`lp' that would check to see if the scheduler was running and respawn it
>if not, then call the real `lp'.  

>However, other times lpsched truely hangs (its running but not doing
>anything).  Sometimes even killing it off and restarting it doesn't do
>any good!  Lpsched just sits there with a dozen jobs on the queue with
>the printer idle!  I have to reboot!  I think that lpsched must use
>some obscure system resource which the system runs out of, but there
>is nothing I can think of that would cause this behavior.  Time to find
>a good PD lp package.
>-- 

No.  There is a race condition in the scheduler.  It can be fixed as follows:

1.	Create a new printer, call it dummy
2.	Make this new printer the system default printer
3.	In the file  /etc/profile  add the following line:

		LPDEST=printer; export LPDEST

	Replace "printer" with what you normally use as your default printer.


To restart the scheduler working properly, perform the following steps:

1.	Type:  /usr/lib/lpshut  to shut the scheduler
2.	Type:  ps -ae | grep lp  to get the pids of all children of the
	scheduler.
3.	kill all the children using a kill -9
4.	Remove the files (if they exist):

		/usr/spool/lp/FIFO
		/usr/spool/lp/SCHEDLOCK
		/usr/spool/lpd/*

5.	Restart the scheduler by typing:  /usr/lib/lpsched



JB
-- 
Jonathan Bayer		Intelligent Software Products, Inc.
(201) 245-5922		500 Oakwood Ave.
jbayer at ispi.COM		Roselle Park, NJ   07204    



More information about the Comp.unix.xenix mailing list