Changeset 1187 for pykota/trunk/docs

Show
Ignore:
Timestamp:
11/15/03 15:59:53 (20 years ago)
Author:
jalet
Message:

Documentation wrt the new CUPS backend.

Location:
pykota/trunk/docs
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/docs/filterpykota.sgml

    r1168 r1187  
    22 
    33<chapter> 
    4   <title id="filter">The pykota filter</title> 
     4  <title id="filter">PyKota's internals</title> 
    55   
    66  <para>Last modified on $Date$</para> 
     
    4949   
    5050  <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. 
    5856  </para> 
    5957   
     
    6664   
    6765  <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, 
    6967    so it has to detect which system you are using (<application>CUPS</application> or <application>LPRng</application>) 
    7068    and behave like if it was specifically designed for your printing system. Fortunately there's not a lot 
     
    7573  <para> 
    7674    When using the <literal>querying</literal> accounting method, 
    77     <application>pykota</application> then asks the printer for its internal page counter, read from the Quota DataBase the internal 
     75    <application>pykota</application> asks the printer for its internal page counter, reads from the Quota DataBase the internal 
    7876    page counter for this printer when the previous job was launched, computes the difference, and report it as the  
    7977    previous job's size in the Quota DataBase. It then updates the last user's print quota and account balance, and 
    8078    warn him if he is over quota or if his account balance is below 0. Finally it checks if the user who launched the  
    8179    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. 
    8385  </para> 
    8486   
     
    106108 
    107109$Log$ 
     110Revision 1.8  2003/11/15 14:59:53  jalet 
     111Documentation wrt the new CUPS backend. 
     112 
    108113Revision 1.7  2003/10/14 20:26:53  jalet 
    109114Better documentation. 
  • pykota/trunk/docs/installation.sgml

    r1168 r1187  
    2929    have to decompress and visit its archive, to do so just type the following commands : 
    3030    <screen> 
    31 jerome@nordine:~$ tar -zxf pykota-1.15_official.tar.gz     
    32 jerome@nordine:~$ cd pykota-1.15_official 
    33 jerome@nordine:~/pykota-1.15_official$ 
     31jerome@nordine:~$ tar -zxf pykota-1.16_official.tar.gz     
     32jerome@nordine:~$ cd pykota-1.16_official 
     33jerome@nordine:~/pykota-1.16_official$ 
    3434    </screen> 
    3535  </para> 
     
    165165        From a command line interpreter (i.e. shell), type the following commands : 
    166166        <screen> 
    167 jerome@nordine:~$ cd pykota-1.15_official/initscripts/postgresql 
    168 jerome@nordine:~/pykota-1.15_official/initscripts$ psql -h localhost -U postgres template1 
     167jerome@nordine:~$ cd pykota-1.16_official/initscripts/postgresql 
     168jerome@nordine:~/pykota-1.16_official/initscripts$ psql -h localhost -U postgres template1 
    169169Welcome to psql, the PostgreSQL interactive terminal. 
    170170 
     
    197197ALTER USER 
    198198pykota=# \q 
    199 jerome@nordine:~/pykota-1.15_official/initscripts/postgresql$ 
     199jerome@nordine:~/pykota-1.16_official/initscripts/postgresql$ 
    200200        </screen> 
    201201      </para> 
     
    582582       
    583583      <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> 
    599595      </para> 
    600596       
     
    608604       
    609605      <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. 
    657617      </para> 
    658618       
     
    671631          Frequently Asked Questions will be included. 
    672632        </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> 
    673688      </sect3>   
    674689       
     
    681696 
    682697$Log$ 
     698Revision 1.22  2003/11/15 14:59:53  jalet 
     699Documentation wrt the new CUPS backend. 
     700 
    683701Revision 1.21  2003/10/14 20:26:53  jalet 
    684702Better documentation.