Here is an intersting question. When I use lprm to delete a print job while it is printing, the printer won't eject the page. When I start the next job, it starts printing right where it left off. What is really frustrating is when the printer is shared in Samba, canceling the print job just cuts off the stream of data. When the next print job comes in, the printer gets confused and does weird things. (Like printing the entire document on one line over and over, resulting in a pool of ink on the page) This is just a minor annoyance, and I was wondering if anyone know how to prevent this, or send a reset command to the printer when a job is canceled.
Thank you.

-Jesse Weigert
jesse@weigert.com

The solution to Jesse's problem can be approached from at least three angles.  One is to use the ld printcap entry to ensure that a reset is sent at the start of each print job.  Another is to recognize that lpd should not just KILL filters that are in use, but should instead send them a SIGINT signal, which can be trapped and acted upon.  The third possibility is to configure SAMBA to send the proper commands when it kills a print job, but this is more difficult, since SAMBA will have no easy means of telling if the job is far down the queue or actually active at the time it is killed.  The solution I posted to Jesse used a shell script to implement the second option.  Which printcap entry needs to be modified to use this?
   #!/bin/bash

   #
   # Print filter to (hopefully) mitigate problem sent to KPLUG
   # mailing list where HP550C chokes when a windows print job
   # is cancelled via the lprm command.
   #
   # Should reset and eject page from a PCL savvy printer upon
   # receipt of SIGINT, otherwise just pass stdin to stdout
   #

   ECHO=/bin/echo -e

   RESET="\033\105"
   EJECT="\033\046\134\060\106"

   #
   # Perform the SIGINT trap
   #
   trap "$ECHO $RESET$EJECT" SIGINT
 

   #
   # normal operation is to pass stdin to stdout
   #
   #
   cat -

   # done