SUMMARY: Accounting and access control over a remote printer

From: <monica_at_alpha.qui.uam.es>
Date: Tue, 18 Mar 1997 15:48:09 +0100

Hello Managers,

Sorry for this late summary, higher priority tasks such as upgrading
all the machines to 4.0b came in, and I had to postpone this problem.


I had two questions summarized here (original question at the end):

1) how to configure a remote printer to do accounting?
2) Is it possible to avoid everyone (except for a few privileged users)
to use
a printer?


Many thanks to all who answered:

"Serge Collin" <serge.collin_at_electrabel.be>
Antonia Gomez <antonia_at_fib.upc.es>
"Eric Wyn Jones (01248-382407)" <e.w.jones_at_bangor.ac.uk>
"WHITTAKER, Bruce" <bjw_at_ansto.gov.au>



** Many thanks to Antonia who gave me the answer to my second question:

From: Antonia Gomez <antonia_at_fib.upc.es>
> Para restringir accesos
> a las impresoras puedes utilizar la opcion "rg" (restricted group) en el
> fichero /etc/printcap. Esta opcion permite especificar un grupo (una
> de las entradas del fichero /etc/group),en ese grupo podras incluir
> a aquellas personas que quieras que utilicen la impresora.
> En las ultimas versiones de Digital Unix no viene documentada esta
> opcion,
> pero yo la utilizo y funciona correctamente.

This is the translation:
In order to restict the access to a printer you can use the rg(resticted group)
option in the /etc/printcap. This option allows you to specify a group (previously
defined in /etc/group) who's members are the ones allowed to use the printer.
In the latest Digital Unix versions this option is not documented but she uses
it and works correctly.

Actually I've also used it and it works fine!!


** As to the first question I would like to give a special thanks Bruce
for his time.

All told me that in order to do accounting one has to define af (accounting
file) and use a filter in if (input filter) when defining the printer in
the /etc/printcap. The problem is with the remote printers which ignore these
fields.

Thanks to the summary of Ran Zahor of the 11th of March (Summary: printing problem)
I saw that for Digital Unix 4.0a and higher one can configure your remote printer
through a tcp/ip port (documentation: Digital_UNIX_V4.0A_Release_Notes page 2-13).
So I added a line in the /etc/services file, added the fields ct=tcp
and lp=_at_printer/port to /etc/printcap.

With this way of defining a remote printer you don't need a dummy printer
to use filters, it does consider the af, if and of fields of the /etc/printcap.

Here is my final printcap:

# remote printer for postscript printing
lp2|2|ps:\
        :af=/usr/adm/lp2acct:\
        :ct=tcp:\
        :if=/usr/lbin/ps_level2of:\
        :lf=/usr/adm/lp2err:\
        :lp=_at_argos/hplaser5m:\
        :mx#0:\
        :of=/usr/lbin/ps_level2of:\
        :rg=system:\
        :rs=true:\
        :sd=/usr/spool/lpd2:\
        :sh:\
        :xf=/usr/lbin/xf:
# remote printer for text printing
lp3|3|text:\
        :af=/usr/adm/lp2acct:\
        :ct=tcp:\
        :if=/usr/lbin/ln03rof:\
        :lf=/usr/adm/lp2err:\
        :lp=_at_argos/hplaser5m:\
        :mx#0:\
        :of=/usr/lbin/ln03rof:\
        :pl#65:\
        :pw#80:\
        :rg=system:\
        :rs=true:\
        :sd=/usr/spool/lpd2:\
        :sh:\
        :xf=/usr/lbin/xf:

I can print text and postscript files with this definition. But the accounting
does only work when the job is text.

What need to be done to have accounting on the postscript jobs? Is it
necessary to write a filter which counts postscript showpage commands?
Has anybody done this before?

Thanks to all

Monica

*************************************************************************

Original posting:


> Dear managers,
>
> Until now, we had only one printer (HPlaserjet 5M) connected directly to
> the net (it has its own IP address) for internal use. Now two color printers
> are going to arrive (again with their own IP address) which should be
> accessible remotely by other machines. On this two printers we want
> to set up accounting so that we can charge for the printed jobs.
>
>
> 1) So my firs question is: how to do printer accounting on a remote printer??
> Before we set up the new printers I wanted to be sure that one can
> do printing-accounting. As all three printers are "remote" printers,
> the af, if and of fields of the printcap ignored (it's assumed the remote
> host will do this, but in this case there is no such remote host).
>
> I found in the archives a summary of Raja Nagaraja explaining how to set
> up a dummy printer so that he could do filtering on the jobs. I tried to
> do the same in order to get accounting but it does not work.
>
> Here is my printcap:
>
> lp1|1|lp|lj5_ascii:\
> :af=/var/adm/printer/lj5_ascii.acct:\
> :if=/usr/lbin/hplaser4psof:\
> :lf=/usr/spool/lpd/lj5_ascii.log:\
> :lp=:\
> :of=/usr/lbin/hplaser4psof:\
> :rm=argos:\
> :rp=text:\
> :sd=/usr/spool/lpd/lj5_ascii:
> # impresora del cccfc con accounting
> lp2|2|text|nueva_lp1_con_acct:\
> :af=/usr/adm/lp2acct:\
> :lf=/usr/adm/lp2err:\
> :lp=/dev/null:\
> :mx#0:\
> :of=/usr/lbin/redirect:\
> :rs=true:\
> :sd=/usr/spool/lpd2:\
> :sh:\
> :xf=/usr/lbin/xf:
>
> Where the file /usr/lbin/redirect is:
> #!/bin/ksh
> /bin/cat - | lpr -Plp1
>
> It works fine except that nothing is written to /usr/adm/lp2acct nor
> /var/adm/printer/lj5_ascii.acct.
> What am I doing wrong??
>
> 2) My second question is the access permisions.
> Is it possible to avoid everyone (except for a few privileged users) to use
> the HPlaserjet printer and at the same time allow to everybody (also
> remote machines) to access the new color printers??
>
> Thanks in advace for your help
> Monica
>
Received on Wed Mar 19 1997 - 00:11:22 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:36 NZDT