Printbill Print Quota System

I should start by saying that the creator of printbill built
printbill to run on Linux.  I have printbill functioning
on my print server but it in no way was a turn-key solution.  I
had to modify the Makefile to suit Solaris.  I built my
installation to work on Solaris 9 and could simply supply
you with a tarball of the installation, just let me know.

Today, 15-OCT-2003,  heard from Daniel Franklin, creator of Printbill,
with the following reply, "No problems - you've also inspired me to fix
some of the build problems on Solaris - stay tuned for some
improved Makfiles :)"  Sounds like he will have some improvements
released before long.

Printbill takes into account paper cost as well as toner cost.
On my HP8150 a single sheet with text costs 1 to 2 cents while
a single sheet with an image costs 5 to 12 cents.
 

Pieces needed to make it all work, I am only covering printbill
in this document.

- Printbill
- Lprng              (I had tried CUPS but wasn't happy with it)
- Ghostscript 7+ (gs that comes with Sun companion CD too old)
 

Caveat: I didn't do a real good job of noting all the changes to
        the Makefile.  If you don't want to struggle through I
        can either send you my Makefile or as I said above, I
        can send you a tarball of the installed system.
 

1) Get printbill.
     http://ieee.uow.edu.au/~daniel/software/printbill/

2) Read the README & README.INSTALLATION files.

3) Sym link 'Config' to Config.solaris

4) Take a look at the Config file and modify to suit your needs.
 
5) Run your 'make'.  Maybe it works flawlessly on linux distributions
   but not on Solaris.  Enough determination and you'll get it working.

6) Copy one of the example init scripts to your /etc/init.d dir and
   modify to suit your needs, or just build your own script.

7) Link startup & init script so it starts on boot.

8) In the dir where printbill has been installed run printbill_configure.
   This sets up the resource file 'printbillrc'.  Printbill_configure
   is a script that asks questions then finishes by populating printbillrc.

   Once the printbillrc file is created you can edit and still tweak yet
   some more.

9) You'll need to put the resulting printbillrc file in the location that
   you want.
 

   Then, you'll need to modify $config var in the following files;

   printbill/bin/pqcheck
   printbill/bin/printquote
   printbill/bin/printbill_grapher

   printbill/sbin/printbill
   printbill/sbin/pqm
   printbill/sbin/printbilld
 
10) Run pqm --init to set up your database of users.  They will be located
    in the location that is stated in printbillrc, db_home:location

11) Run pqm --add userid, to add users to the printbill database.
    Run pqm --inc userid --amount 10 to give userid 10 currency units.

    pqm without any command line parameters will give the help info.

    I have a small script when adding department accounts to automatically
    add printbill users.

12) Fire up the printbill daemon via your '/etc/init.d/printbill  start'

13) You'll need to modify your /etc/printcap file to add the printbill
    hooks.  With lprng remember to 'checkpc -f; lpc reread' afterward.
 
    Example printer entry

    prn1:\
        :achk=true
        :as=|/usr/local/printbill/sbin/printbill --type bill
                                     --printbill_secondary prn_real:\
        :lp=/dev/null:\
        :mc=0:\
        :mx=0:\
        :sd=/var/spool/lpd/%P:
 

        # Added by ./printbill_configure
        prn_real|Real print queue for chps (don't print to this):\
        :achk=true
        :lp=141.219.29.32%9100:\
        :sd=/var/spool/lpd/prn_real:\

14) Start testing by sending print jobs to the prn1 printer.
 

Note:  I have made a couple of modifications to the source code to facilitate reports.
          If you let me know you are interested I'll send you the info.