1.2. Print Server Installation

For each Print Server on which you plan to implement the print quota mechanism, you have, of course, to have an already working printing environment. Currently PyKota works with either CUPS or LPRng, but more printing systems may be added in the future.

Here's the list of software you have to install on each Print Server, version numbers are given as an indication of which was successfully tested, but older versions may work too.

Instead of downloading all these programs' sources and compiling them, which really is a boring task considering that many software are needed, you may prefer to look into the packages included with your GNU/Linux distribution of choice (if you use this operating system of course). Most, if not all, GNU/Linux distributions include all the software mentionned above, in the form of packages which are easier to install than sources tarballs. This is probably the same for the many *BSD distributions.

Once all these software are installed, installing PyKota itself is a breeze. PyKota being written entirely in the Python language, which is interpreted, there's no need to compile anything. You just have to execute the installation script :

      
$ python setup.py install      
      

The installation script will try to do a safe upgrade if needed. Also it will check if some needed software is missing or unavailable and will tell you so. This may be the case for example if you installed several versions of the Python language, and some Python modules are only available for one of them which is not the one you are actually running.

On your first installation, the setup script will automatically create the /etc/pykota directory and put the sample configuration files conf/pykota.conf.sample and conf/pykotadmin.conf.sample there, after having renamed them respectively pykota.conf and pykotadmin.conf. Once copied there, you just have to modify these files to adapt them to your own setup. These files are heavily commented, so you should have no problem. Also their format is quite common, because it's the one used by Samba for example, or by .ini files under MS-Windows, so you may already be familiar with this syntax. In a future release, this documentation will include the complete reference for all configuration fields available. Keep in mind that PyKota can be really heavily customized, and can delegate some work to any external command of your choice.

On later installations, the setup script won't modify any of your configuration files. However it will try to explain what have changed and encourages you to manually do the modifications which are needed. Please create a backup of the /etc/pykota directory before modifying anything. Under some circumstances, the setup PyKota may refuse to install PyKota until you have modified your configuration. Just do it and restart the installation script as described above.

PyKota features some interesting possibilities which allow you to define options either globally so that they apply to all printers, or on a per printer basis. Please see the sample configuration files to see what I mean. In the simplest form, only a global section is needed. In more complex configurations, you will have to create one section per printer. Each section in the configuration files begins with a name between square brackets []. The name to use to define a particular printer section is the name of the print queue on which you want to set quotas.

After you have modified PyKota's configuration files, you have to double check their permissions, otherwise your installation may be insecure or may not work at all. The main configuration file /etc/pykota/pykota.conf doesn't contain much sensitive information, so it can be made readable by anyone. If normal users read this file, at best they will learn the username and optional password of the read-only database user, so they won't be allowed to do any harm. On the other hand, the /etc/pykota/pykotadmin.conf file contains the read-write user's identity and password. You must then ensure that no normal user can read this file. It should only be readable by the root user, which is always the case, by the user your printing system is running as, and optionally by the print administrators, who are usually members of the lpadmin group. Under my Debian GNU/Linux system, with CUPS, here's how to do to give the correct permissions :

$ chown root.root /etc/pykota/pykota.conf      
$ chmod 644 /etc/pykota/pykota.conf      
$ chown lp.lpadmin /etc/pykota/pykotadmin.conf      
$ chmod 640 /etc/pykota/pykotadmin.conf      
      

Now depending on your printing system, the configuration to do is particular. We will now see how to plug PyKota into your printing system.

1.2.1. With CUPS

From version 1.16alpha7 on, configuring PyKota to integrate within CUPS is more than easy.

You just have to create a symbolic link to the cupspykota command in CUPS' backend directory :

        
$ cd /usr/lib/cups/backend        
$ ln -s /usr/share/pykota/cupspykota cupspykota
        

You have to restart CUPS for this modification to take effect :

$ /etc/init.d/cupsys restart        
        

Now point your web browser to CUPS configuration page, usually at http://localhost:631 on your print server.

Then when creating new printers or reconfiguring existing ones, just choose devices which are PyKota managed instead of normal devices. You've got one PyKota managed device for each regular device available from CUPS, so just choose the appropriate one.

Repeat the above procedure for each print queue on which you want to use PyKota. That's all !

1.2.1.1. Troubleshooting

In case of problem, the simplest way to solve it is currently to ask on PyKota's mailing list, describing the symptoms, as well as the hardware and software you use. In a future release of this document, a section dedicated to Frequently Asked Questions will be included.

You can now also ask us questions on IRC :

/server irc.freenode.net          
/join #pykota
          

1.2.2. With LPRng

######### TODO ##########

You have to restart LPRng for this modification to take effect :

$ /etc/init.d/lprng restart        
        

Repeat the above procedure for each print queue on which you want to use PyKota. That's all !

1.2.2.1. Troubleshooting

In case of problem, the simplest way to solve it is currently to ask on PyKota's mailing list, describing the symptoms, as well as the hardware and software you use. In a future release of this document, a section dedicated to Frequently Asked Questions will be included.

You can now also ask us questions on IRC :

/server irc.freenode.net          
/join #pykota