Changeset 1168 for pykota/trunk/docs

Show
Ignore:
Timestamp:
10/14/03 22:26:53 (21 years ago)
Author:
jalet
Message:

Better documentation.
1.15 is out !

Location:
pykota/trunk/docs
Files:
3 modified

Legend:

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

    r959 r1168  
    4242      <listitem> 
    4343        <para> 
    44           Switch users or groups to <quote>account only</quote> mode (no quota enforcement) ; 
     44          Switch users or groups to or from <quote>account only</quote> mode (no quota enforcement) ; 
    4545        </para> 
    4646      </listitem> 
     
    6363 
    6464$Log$ 
     65Revision 1.4  2003/10/14 20:26:53  jalet 
     66Better documentation. 
     671.15 is out ! 
     68 
    6569Revision 1.3  2003/04/24 21:09:47  jalet 
    6670Documentation slightly improved. 
  • pykota/trunk/docs/filterpykota.sgml

    r1101 r1168  
    3232    The <application>pstops</application> filter described above is also in charge of doing basic page 
    3333    accounting, but <application>PyKota</application> currently doesn't use this facility since it may 
    34     prove to be unreliable depending on the drivers used or if a paper jam occur for example. 
     34    prove to be unreliable depending on the drivers used or if a paper jam occurs for example. 
    3535  </para> 
    3636   
     
    7979    previous job's size in the Quota DataBase. It then updates the last user's print quota and account balance, and 
    8080    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     current job is below or above his print quota, and either allow or deny the job's datas to pass to the underlying  
     81    current job is below or above his print quota, and either allows or denies the job's datas to pass to the underlying  
    8282    layer (the printer itself). 
    8383  </para> 
     
    9696  <para> 
    9797    If a problem occurs, it is logged either to the filter's standard output or to the system logger, depending on 
    98     your preferences in <application>PyKota</application>'s configuration file. Also if a print quota is reached 
     98    your preferences in <application>PyKota</application>'s configuration files. Also if a print quota is reached 
    9999    you may choose if the administrator, the user, both or no-one will receive an email message explaining 
    100100    the situation and proposing a solution. 
     
    106106 
    107107$Log$ 
     108Revision 1.7  2003/10/14 20:26:53  jalet 
     109Better documentation. 
     1101.15 is out ! 
     111 
    108112Revision 1.6  2003/07/25 13:10:58  jalet 
    109113Improved documentation 
  • pykota/trunk/docs/installation.sgml

    r1104 r1168  
    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.14_official.tar.gz     
    32 jerome@nordine:~$ cd pykota-1.14_official 
    33 jerome@nordine:~/pykota-1.14_official$ 
     31jerome@nordine:~$ tar -zxf pykota-1.15_official.tar.gz     
     32jerome@nordine:~$ cd pykota-1.15_official 
     33jerome@nordine:~/pykota-1.15_official$ 
    3434    </screen> 
    3535  </para> 
     
    4545    You have to compile these files into readable documentation like the <acronym>HTML</acronym> 
    4646    or <acronym>PDF</acronym> formats, or buy an official <application>PyKota</application> package 
    47     which already contains these compiled forms of the documentation. 
     47    which already contains these compiled forms of the documentation. Of course you already 
     48    know this because that's what you are currently reading ! 
    4849  </para> 
    4950   
     
    100101        To do so you either have to launch it with the <option>-i</option> option or 
    101102        modify the <filename>/etc/postgresql/postgresql.conf</filename> file, which is 
    102         self documented and easy to modify too. 
     103        self documented and easy to modify too. Allowing <acronym>TCP/IP</acronym> connections 
     104        is not necessary though if your Quota Storage Server and your Print Server are 
     105        the very same host. 
    103106        <tip> 
    104107          <title>Tip</title> 
     
    136139        The Quota DataBase Administrator is not present in the Quota Database 
    137140        itself, he is only defined in <application>PostgreSQL</application> and don't 
    138         have to exist on any system, nor in the Quota DataBase. His default names 
     141        have to exist on any system, nor in the Quota DataBase. His default name 
    139142        is <literal>pykotaadmin</literal>.  
    140143        A Quota Storage read-only user is also created under the name of <literal>pykotauser</literal>. 
     
    162165        From a command line interpreter (i.e. shell), type the following commands : 
    163166        <screen> 
    164 jerome@nordine:~$ cd pykota-1.14_official/initscripts/postgresql 
    165 jerome@nordine:~/pykota-1.14_official/initscripts$ psql -h localhost -U postgres template1 
     167jerome@nordine:~$ cd pykota-1.15_official/initscripts/postgresql 
     168jerome@nordine:~/pykota-1.15_official/initscripts$ psql -h localhost -U postgres template1 
    166169Welcome to psql, the PostgreSQL interactive terminal. 
    167170 
     
    194197ALTER USER 
    195198pykota=# \q 
    196 jerome@nordine:~/pykota-1.14_official/initscripts/postgresql$ 
     199jerome@nordine:~/pykota-1.15_official/initscripts/postgresql$ 
    197200        </screen> 
    198201      </para> 
     
    232235          <para> 
    233236            If an error occured, maybe your PostgreSQL version is too old, or 
    234             an unexpected problem (like a bug) happened. Please send me an email so that I 
     237            an unexpected problem (like a bug) happened. Please contact us via email so that we 
    235238            can try to solve the problem. Thanks in advance. 
    236239          </para> 
     
    241244     
    242245    <sect2> 
    243       <title>LDAP</title> 
     246      <title>OpenLDAP</title> 
    244247       
    245248      <para> 
    246249        From version 1.09 on, <application>OpenLDAP</application> can be used as a Quota Storage Backend. 
    247250        It is possible that other LDAP servers can be used, but this is currently untested. 
     251      </para> 
     252       
     253      <para> 
     254        <application>OpenLDAP</application> is a Lightweight Directory Access Protocol server 
     255        implementation published as Free Software. 
     256        You can download it from <ulink url="http://www.openldap.org">http://www.openldap.org</ulink>. 
    248257      </para> 
    249258       
     
    270279        </screen>         
    271280      </para> 
     281       
     282      <para> 
     283        While this is not mandatory, it is recommended that you setup 
     284        some indexes for some often accessed PyKota attributes. 
     285        Actually, the <acronym>LDAP</acronym> schema included with 
     286        PyKota doesn't allow indexes of another type than <literal>eq</literal>, 
     287        but this will change in a next release. Here are the minimal indexes 
     288        lines you may want to put in <filename>slapd.conf</filename> : 
     289        <screen> 
     290# Indexes for PyKota 
     291index pykotaUserName eq 
     292index pykotaGroupName eq 
     293index pykotaPrinterName eq 
     294index pykotaLastJobIdent eq 
     295        </screen> 
     296      </para> 
     297       
    272298      <para> 
    273299        Finally, restart the <application>OpenLDAP</application> server :     
     
    278304       
    279305      <para> 
    280         Then you have to modify PyKota's configuration files <filename>/etc/pykota/pykota.conf</filename> 
     306        With an <acronym>LDAP</acronym> backend, PyKota will need some branches 
     307        in your <acronym>LDAP</acronym> directory to put its own datas. 
     308        You can configure PyKota to either attach its datas to your existing 
     309        users and groups, or to put them in their own <literal>ou</literal>. 
     310        But some <literal>ou</literal>s dedicated to PyKota are needed in any case, 
     311        so the best bet may be to put all PyKota's datas below an <literal>ou=PyKota</literal> 
     312        branch. While this will separate these datas from your existing users and groups 
     313        entries, this may ease the maintainance. 
     314      </para> 
     315       
     316      <para> 
     317        PyKota needs at least an <literal>ou</literal> for printers, for users quotas, for 
     318        groups quotas, for print jobs, and for pointers to the last job of each printer. 
     319        In the future, this last <literal>ou</literal> may disappear as its content 
     320        will probably be attached to each printer. 
     321      </para> 
     322       
     323      <para> 
     324        Actually PyKota doesn't create these <literal>ou</literal>s for you, because it's 
     325        difficult to guess what is the best configuration for you. So you have to 
     326        create them by yourself, either directly with a text editor and the 
     327        <application>ldapadd</application> command, or with some specialized tool 
     328        like <application>gq</application>. 
     329      </para> 
     330       
     331      <para> 
     332        Once you have chosen and created your directory structure, you have to modify PyKota's configuration files <filename>/etc/pykota/pykota.conf</filename> 
    281333        and <filename>/etc/pykota/pykotadmin.conf</filename> 
    282         to include LDAP specific options. You may want to give a look at  
     334        to set some LDAP specific options and binding <literal>dn</literal>s. The easiest is 
     335        probably to give a look at  
    283336        <filename>pykota/conf/pykota.conf.sample</filename> to see all the options that are 
    284337        needed. Adapt the values to your own configuration, and finally initialize your  
     
    314367      For each Print Server on which you plan to implement the print quota 
    315368      mechanism, you have, of course, to have an already working printing environment.  
    316       Currently <application>PyKota</application> works with either the 
     369      Currently <application>PyKota</application> works with either  
    317370      <ulink url="http://www.cups.org"><application>CUPS</application></ulink> 
    318       or the <ulink url="http://lprng.sourceforge.net"><application>LPRng</application></ulink>, 
    319       but more may be added in the future. 
     371      or <ulink url="http://lprng.sourceforge.net"><application>LPRng</application></ulink>, 
     372      but more printing systems may be added in the future. 
    320373    </para> 
    321374     
     
    356409                      <para> 
    357410                        The <application>PygreSQL</application> python module.  
    358                         It must match the  
    359                         <application>PostgreSQL</application> client libraries' 
    360                         version, as well as Python's version. 
     411                        It must have been compiled against the same 
     412                        <application>PostgreSQL</application> client libraries. 
     413                        <application>PygreSQL</application> is normally included in 
     414                        <application>PostgreSQL</application>, but you may want to 
     415                        download it from <ulink url="http://www.pygresql.org">http://www.pygresql.org</ulink> 
    361416                      </para> 
    362417                    </listitem>   
     
    366421              <listitem> 
    367422                <para> 
    368                   LDAP backend : TODO 
     423                  OpenLDAP backend :  
     424                  <itemizedlist> 
     425                    <listitem> 
     426                      <para> 
     427                        <application>OpenLDAP</application> client libraries. They must match 
     428                        the <application>OpenLDAP</application> version used on your Quota Storage Server. 
     429                      </para> 
     430                    </listitem>   
     431                    <listitem> 
     432                      <para> 
     433                        The <application>Python-LDAP</application> python module. 
     434                        It must have been compiled against the same 
     435                        <application>OpenLDAP</application> client libraries. 
     436                        You may download this module from <ulink url="http://python-ldap.sourceforge.net">http://python-ldap.sourceforge.net</ulink> 
     437                      </para> 
     438                    </listitem>   
     439                  </itemizedlist> 
    369440                </para> 
    370441              </listitem> 
     
    386457            <application>ucd-snmp</application> or <application>net-snmp</application> tools, version 4.2.5 or above. You only need 
    387458            the <application>snmpget</application> command. 
    388             You can download them from <ulink url="http://www.sourceforge.net/projects/net-snmp/">http://www.sourceforge.net/projects/net-snmp/</ulink>. 
     459            You can download this software from <ulink url="http://www.sourceforge.net/projects/net-snmp/">http://www.sourceforge.net/projects/net-snmp/</ulink>. 
    389460            You only need this if you plan to query your printers for their internal page counter via SNMP. 
    390461          </para> 
     
    394465            <application>netatalk</application> version 1.6.1 or above. You only need 
    395466            the <application>pap</application> command. 
    396             You can download them from <ulink url="http://netatalk.sourceforge.net/">http://netatalk.sourceforge.net/</ulink>. 
     467            You can download this software from <ulink url="http://netatalk.sourceforge.net/">http://netatalk.sourceforge.net/</ulink>. 
    397468            You only need this if you plan to query your printers for their internal page counter via AppleTalk. 
    398469          </para> 
     
    406477      </itemizedlist>   
    407478    </para> 
     479     
     480    <para> 
     481      Instead of downloading all these programs' sources and compiling them, which really 
     482      is a boring task considering that many software are needed, you may prefer to look 
     483      into the packages included with your GNU/Linux distribution of choice (if you use 
     484      this operating system of course). Most, if not all, GNU/Linux distributions include 
     485      all the software mentionned above, in the form of packages which are easier to 
     486      install than sources tarballs. This is probably the same for the many *BSD 
     487      distributions. 
     488    </para> 
     489     
     490    <para> 
     491      Once all these software are installed, installing PyKota itself is a breeze. 
     492      PyKota being written entirely in the Python language, which is interpreted,  
     493      there's no need to compile anything. You just have to execute the installation 
     494      script : 
     495      <screen>       
     496$ python setup.py install       
     497      </screen> 
     498    </para> 
     499     
     500    <para> 
     501      The installation script will try to do a safe upgrade if needed.  
     502      Also it will check if some needed software is missing or unavailable  
     503      and will tell you so. This may be the case for example if you  
     504      installed several versions of the Python language, and some Python  
     505      modules are only available for one of them which is not the one you  
     506      are actually running.  
     507    </para> 
     508     
     509    <para> 
     510      On your first installation, the setup script will automatically create 
     511      the <filename>/etc/pykota</filename> directory and put the sample  
     512      configuration files <filename>conf/pykota.conf.sample</filename> and 
     513      <filename>conf/pykotadmin.conf.sample</filename> there, after having 
     514      renamed them respectively <filename>pykota.conf</filename> and  
     515      <filename>pykotadmin.conf</filename>. Once copied there, you just 
     516      have to modify these files to adapt them to your own setup. 
     517      These files are heavily commented, so you should have no problem. 
     518      Also their format is quite common, because it's the one used by 
     519      <application>Samba</application> for example, or by <literal>.ini</literal> 
     520      files under <application>MS-Windows</application>, so you may already 
     521      be familiar with this syntax. 
     522      In a future release, this documentation will include the complete 
     523      reference for all configuration fields available. Keep in mind that 
     524      PyKota can be really heavily customized, and can delegate some work 
     525      to any external command of your choice. 
     526    </para> 
     527     
     528    <para> 
     529      On later installations, the setup script won't modify any of your 
     530      configuration files. However it will try to explain what have changed 
     531      and encourages you to manually do the modifications which are needed. 
     532      Please create a backup of the <filename>/etc/pykota</filename> 
     533      directory before modifying anything. 
     534      Under some circumstances, the setup PyKota may refuse to install PyKota 
     535      until you have modified your configuration. Just do it and restart 
     536      the installation script as described above. 
     537    </para> 
     538     
     539    <para> 
     540      PyKota features some interesting possibilities which allow you to 
     541      define options either globally so that they apply to all printers, 
     542      or on a per printer basis. Please see the sample configuration files 
     543      to see what I mean. In the simplest form, only a global section is 
     544      needed. In more complex configurations, you will have to create  
     545      one section per printer. Each section in the configuration files 
     546      begins with a name between square brackets <literal>[]</literal>. 
     547      The name to use to define a particular printer section is the name 
     548      of the print queue on which you want to set quotas. 
     549    </para> 
     550     
     551    <para> 
     552      After you have modified PyKota's configuration files, you have to 
     553      double check their permissions, otherwise your installation may be 
     554      insecure or may not work at all. 
     555      The main configuration file <filename>/etc/pykota/pykota.conf</filename> 
     556      doesn't contain much sensitive information, so it can be made 
     557      readable by anyone. If normal users read this file, at best they 
     558      will learn the username and optional password of the read-only 
     559      database user, so they won't be allowed to do any harm. 
     560      On the other hand, the <filename>/etc/pykota/pykotadmin.conf</filename> 
     561      file contains the read-write user's identity and password. You must then 
     562      ensure that no normal user can read this file. It should only be readable 
     563      by the <literal>root</literal> user, which is always the case, by 
     564      the user your printing system is running as, and optionally by the print administrators, 
     565      who are usually members of the <literal>lpadmin</literal> group. Under my Debian GNU/Linux system, 
     566      with CUPS, here's how to do to give the correct permissions : 
     567      <screen> 
     568$ chown root.root /etc/pykota/pykota.conf       
     569$ chmod 644 /etc/pykota/pykota.conf       
     570$ chown lp.lpadmin /etc/pykota/pykotadmin.conf       
     571$ chmod 640 /etc/pykota/pykotadmin.conf       
     572      </screen> 
     573    </para> 
     574     
     575    <para> 
     576      Now depending on your printing system, the configuration to do is particular. 
     577      We will now see how to plug PyKota into your printing system. 
     578    </para> 
     579     
     580    <sect2> 
     581      <title>With CUPS</title> 
     582       
     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. 
     599      </para> 
     600       
     601      <para> 
     602        You have to restart <application>CUPS</application> for this modification to 
     603        take effect :  
     604        <screen> 
     605$ /etc/init.d/cupsys restart         
     606        </screen> 
     607      </para> 
     608       
     609      <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> 
     657      </para> 
     658       
     659      <para> 
     660        Repeat the above procedure for each print queue on which you want to use 
     661        PyKota. That's all ! 
     662      </para> 
     663       
     664      <sect3> 
     665        <title>Troubleshooting</title> 
     666        <para> 
     667          In case of problem, the simplest way to solve it is currently 
     668          to ask on PyKota's mailing list, describing the symptoms, as 
     669          well as the hardware and software you use. 
     670          In a future release of this document, a section dedicated to  
     671          Frequently Asked Questions will be included. 
     672        </para> 
     673      </sect3>   
     674       
     675    </sect2> 
     676     
    408677  </sect1>   
    409678</chapter> 
     
    412681 
    413682$Log$ 
     683Revision 1.21  2003/10/14 20:26:53  jalet 
     684Better documentation. 
     6851.15 is out ! 
     686 
    414687Revision 1.20  2003/07/25 13:20:32  jalet 
    415688Typo which wasn't