> From [EMAIL PROTECTED] Thu Jan  3 12:21:23 2002
> Date: Thu, 03 Jan 2002 14:20:07 -0600
> From: "Cal Staples" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Subject: LPRng Question
>
> Patrick
>
> I appreciate your taking time to assist me with this question.
>
> I have a print queue that I need to "dump" anything that comes
> into it.  The following is the stanza from the printcap.all file:
>
> uhcr01a
>         :lp=uhcr01a@localhost
>         :bq=pr1@uhcr01-lpd
>         :if=/usr/local/libexec/filters/pcl l c
>         # rx
>
> The problem I have is the vendor requires a "system printer" but
> nobody wants to waste the reams of paper it produces.  I would love
> to be able to redirect it's queue to "/dev/null" or some other way
> of automatically emptying it's queue without sending it to a printer.

>
> Thanks in advance...
>
> Cal

This is pretty common,  and steals a trick from the syslog files.

Here is how you set the printcap up:

logger|alias_for_stupid_programs|...
  :lp=/var/run/logger/outfile
  :filter=/usr/libexec/filters/neatformatter

#!/bin/sh
# neatformatter
echo "--------- JOB START -------"
echo $0 "$@"
/bin/cat
echo "--------- JOB END -------"
exit 0

Now when you print a job it goes into the /var/run/logger/outfile with
each file separated by JOB START and JOB END lines.

You must modify your 'lpd startup script' a bit to create the
directory for the outfile;  make sure you have ownership correct.
The owner will either be 'daemon' or 'lp' depending on your system.

  #...
  start)
     if [ ! -d /var/run/logger ] ; then
                 mkdir -p /var/run/logger
     fi
     chown lp /var/run/logger

And finally, the crowning touch:  you can do file rollover as well.

I use the program 'newsyslog' with the following entry:

 configuration file for newsyslog
# $FreeBSD: src/etc/newsyslog.conf,v 1.25.2.4 2001/02/26 09:26:11 phk Exp $
#
# logfilename          [owner:group]    mode count size when [ZB] [/pid_file] [sig_num]
/var/run/logger/outfile lp:lp           660  10    1000 *     Z


This says 'update the /var/run/logger/outfile using owner:group lp:lp and creat
it with mode 660 perms.  Keep at most 10 files, and roll over when they reach
1000 Kbytes.  Compress them using Gzip.


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