- Timestamp:
- 11/15/03 15:59:53 (21 years ago)
- Location:
- pykota/trunk/docs
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/docs/filterpykota.sgml
r1168 r1187 2 2 3 3 <chapter> 4 <title id="filter"> The pykota filter</title>4 <title id="filter">PyKota's internals</title> 5 5 6 6 <para>Last modified on $Date$</para> … … 49 49 50 50 <para> 51 Currently with a <application>CUPS</application> backend, the <application>pykota</application> filter is used at the very last stage of the print mechanism, 52 just before the final data is sent to the printer, but it may eventually be used earlier with some 53 modifications to <application>CUPS</application>'s filtering configuration. 54 You can find in the mailing list archives of July 2003 an explanation on how to do this. 55 This may allow you to use PyKota with a not-PostScript printer or with a PostScript printer 56 which really needs to have 57 a specific filter like <application>magicfilter</application> or <application>cupsomatic</application>. 51 Currently with a <application>CUPS</application> backend, the <application>pykota</application> filter is 52 deprecated. You have to use the <application>cupspykota</application> CUPS backend instead. 53 This CUPS backend ensures that jobs can't bypass the filtering mechanism, so you can use 54 any printer with any driver and any command line option, and you can be sure that your 55 print job will be correctly accounted for. 58 56 </para> 59 57 … … 66 64 67 65 <para> 68 When you submit a print job, <application> pykota</application>is automatically launched by your printing system,66 When you submit a print job, <application>cupspykota</application> (with CUPS) or <application>pykota</application> (with LPRng) is automatically launched by your printing system, 69 67 so it has to detect which system you are using (<application>CUPS</application> or <application>LPRng</application>) 70 68 and behave like if it was specifically designed for your printing system. Fortunately there's not a lot … … 75 73 <para> 76 74 When using the <literal>querying</literal> accounting method, 77 <application>pykota</application> then asks the printer for its internal page counter, readfrom the Quota DataBase the internal75 <application>pykota</application> asks the printer for its internal page counter, reads from the Quota DataBase the internal 78 76 page counter for this printer when the previous job was launched, computes the difference, and report it as the 79 77 previous job's size in the Quota DataBase. It then updates the last user's print quota and account balance, and 80 78 warn him if he is over quota or if his account balance is below 0. Finally it checks if the user who launched the 81 79 current job is below or above his print quota, and either allows or denies the job's datas to pass to the underlying 82 layer (the printer itself). 80 layer (the printer itself). The <application>cupspykota</application> CUPS backend on the other hand, 81 asks the printer for its internal page counter at the start and at the end of the print job, and 82 computes the values' difference so accounting is done immediately. This way it doesn't let open a window for abuse in the case 83 several printers are managed. That's why the use of <application>cupspykota</application> 84 instead of <application>pykota</application> is recommanded with CUPS. 83 85 </para> 84 86 … … 106 108 107 109 $Log$ 110 Revision 1.8 2003/11/15 14:59:53 jalet 111 Documentation wrt the new CUPS backend. 112 108 113 Revision 1.7 2003/10/14 20:26:53 jalet 109 114 Better documentation. -
pykota/trunk/docs/installation.sgml
r1168 r1187 29 29 have to decompress and visit its archive, to do so just type the following commands : 30 30 <screen> 31 jerome@nordine:~$ tar -zxf pykota-1.1 5_official.tar.gz32 jerome@nordine:~$ cd pykota-1.1 5_official33 jerome@nordine:~/pykota-1.1 5_official$31 jerome@nordine:~$ tar -zxf pykota-1.16_official.tar.gz 32 jerome@nordine:~$ cd pykota-1.16_official 33 jerome@nordine:~/pykota-1.16_official$ 34 34 </screen> 35 35 </para> … … 165 165 From a command line interpreter (i.e. shell), type the following commands : 166 166 <screen> 167 jerome@nordine:~$ cd pykota-1.1 5_official/initscripts/postgresql168 jerome@nordine:~/pykota-1.1 5_official/initscripts$ psql -h localhost -U postgres template1167 jerome@nordine:~$ cd pykota-1.16_official/initscripts/postgresql 168 jerome@nordine:~/pykota-1.16_official/initscripts$ psql -h localhost -U postgres template1 169 169 Welcome to psql, the PostgreSQL interactive terminal. 170 170 … … 197 197 ALTER USER 198 198 pykota=# \q 199 jerome@nordine:~/pykota-1.1 5_official/initscripts/postgresql$199 jerome@nordine:~/pykota-1.16_official/initscripts/postgresql$ 200 200 </screen> 201 201 </para> … … 582 582 583 583 <para> 584 The easiest way to configure PyKota to be used for a particular <application>CUPS</application> print queue, 585 is to modify the <literal>PPD</literal> file associated with this print queue. 586 Say you want to set quotas on the <literal>HPLaser</literal> print queue. You 587 then just have to modify the file <filename>/etc/cups/ppd/HPLaser.ppd</filename>. 588 You will have to add the following lines somewhere near the beginning of this file : 589 <screen> 590 *% Print Quota System 591 *cupsFilter: "application/vnd.cups-postscript 0 /usr/bin/pykota" 592 </screen> 593 </para> 594 595 <para> 596 The first line is a comment. The second one tells <application>CUPS</application> 597 to launch PyKota's accounting filter just before sending the print job to 598 the printer's hardware. 584 From version 1.16alpha7 on, configuring PyKota to integrate 585 within CUPS is more than easy. 586 </para> 587 588 <para> 589 You just have to create a symbolic link to the <filename>cupspykota</filename> 590 command in CUPS' backend directory : 591 <screen> 592 $ cd /usr/lib/cups/backend 593 $ ln -s /usr/bin/cupspykota cupspykota 594 </screen> 599 595 </para> 600 596 … … 608 604 609 605 <para> 610 Repeat the above procedure for each print queue on which you want to use 611 PyKota. That's all ! 612 </para> 613 614 <sect3> 615 <title>Troubleshooting</title> 616 <para> 617 NB : the above procedure only works with <literal>PPD</literal> files which 618 don't already contain an <literal>*cupsFilter</literal> line. PostScript 619 printers usually don't need this line, but other types of printers may need 620 it. A different procedure exists for such printers, but it is not actually 621 documented. Search the mailing list archives at 622 <ulink url="http://cgi.librelogiciel.com/mailman/listinfo/pykota"> 623 http://cgi.librelogiciel.com/mailman/listinfo/pykota 624 </ulink> to learn how to do. 625 </para> 626 627 <para> 628 In case of problem, the simplest way to solve it is currently 629 to ask on PyKota's mailing list, describing the symptoms, as 630 well as the hardware and software you use. 631 In a future release of this document, a section dedicated to 632 Frequently Asked Questions will be included. 633 </para> 634 </sect3> 635 636 </sect2> 637 638 <sect2> 639 <title>With LPRng</title> 640 <para> 641 To plug PyKota into your <application>LPRng</application> setup, 642 you have to modify the <filename>/etc/printcap</filename>. 643 You just have to add the following lines to each queue on 644 which you want to use PyKota : 645 <screen> 646 :achk=true 647 :as=|/usr/bin/pykota 648 </screen> 649 </para> 650 651 <para> 652 You have to restart <application>LPRng</application> for this modification to 653 take effect : 654 <screen> 655 $ /etc/init.d/lprng restart 656 </screen> 606 Now point your web browser to CUPS configuration page, usually at 607 <ulink url="http://localhost:631">http://localhost:631</ulink> on 608 your print server. 609 </para> 610 611 <para> 612 Then when creating new printers or reconfiguring existing ones, just 613 choose devices which are <literal>PyKota managed</literal> instead of 614 normal devices. You've got one <literal>PyKota managed</literal> device 615 for each regular device available from CUPS, so just choose the appropriate 616 one. 657 617 </para> 658 618 … … 671 631 Frequently Asked Questions will be included. 672 632 </para> 633 634 <para> 635 You can now also ask us questions on IRC : 636 <screen> 637 /server irc.freenode.net 638 /join #pykota 639 </screen> 640 </para> 641 </sect3> 642 643 </sect2> 644 645 <sect2> 646 <title>With LPRng</title> 647 <para> 648 To plug PyKota into your <application>LPRng</application> setup, 649 you have to modify the <filename>/etc/printcap</filename>. 650 You just have to add the following lines to each queue on 651 which you want to use PyKota : 652 <screen> 653 :achk=true 654 :as=|/usr/bin/pykota 655 </screen> 656 </para> 657 658 <para> 659 You have to restart <application>LPRng</application> for this modification to 660 take effect : 661 <screen> 662 $ /etc/init.d/lprng restart 663 </screen> 664 </para> 665 666 <para> 667 Repeat the above procedure for each print queue on which you want to use 668 PyKota. That's all ! 669 </para> 670 671 <sect3> 672 <title>Troubleshooting</title> 673 <para> 674 In case of problem, the simplest way to solve it is currently 675 to ask on PyKota's mailing list, describing the symptoms, as 676 well as the hardware and software you use. 677 In a future release of this document, a section dedicated to 678 Frequently Asked Questions will be included. 679 </para> 680 681 <para> 682 You can now also ask us questions on IRC : 683 <screen> 684 /server irc.freenode.net 685 /join #pykota 686 </screen> 687 </para> 673 688 </sect3> 674 689 … … 681 696 682 697 $Log$ 698 Revision 1.22 2003/11/15 14:59:53 jalet 699 Documentation wrt the new CUPS backend. 700 683 701 Revision 1.21 2003/10/14 20:26:53 jalet 684 702 Better documentation.