[695] | 1 | # $Id$ |
---|
| 2 | |
---|
[952] | 3 | PyKota - Print Quota for CUPS and LPRng |
---|
[695] | 4 | |
---|
[1257] | 5 | (c) 2003-2004 Jerome Alet <alet@librelogiciel.com> |
---|
[873] | 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2 of the License, or |
---|
| 9 | (at your option) any later version. |
---|
[695] | 10 | |
---|
[873] | 11 | This program is distributed in the hope that it will be useful, |
---|
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 14 | GNU General Public License for more details. |
---|
[695] | 15 | |
---|
[873] | 16 | You should have received a copy of the GNU General Public License |
---|
| 17 | along with this program; if not, write to the Free Software |
---|
[2303] | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
---|
[873] | 19 | |
---|
[761] | 20 | ==================================================================== |
---|
[695] | 21 | |
---|
[1052] | 22 | READ SPECIAL LICENSING AND REDISTRIBUTION TERMS IN THE FILE 'LICENSE' |
---|
[761] | 23 | |
---|
| 24 | ==================================================================== |
---|
| 25 | |
---|
[1154] | 26 | PyKota features : |
---|
| 27 | ----------------- |
---|
[695] | 28 | |
---|
[2051] | 29 | Free Software : |
---|
| 30 | |
---|
| 31 | - Licensed under the terms of the GNU General Public License. |
---|
| 32 | |
---|
| 33 | Commercially Supported : |
---|
| 34 | |
---|
| 35 | - Support Contracts are available from http://www.librelogiciel.com/techsupport/ |
---|
| 36 | |
---|
[1154] | 37 | Operating systems : |
---|
| 38 | |
---|
| 39 | - Any Unix-like system as print server. |
---|
| 40 | |
---|
| 41 | - Any operating system as client. |
---|
| 42 | |
---|
| 43 | Printing systems : |
---|
| 44 | |
---|
[1283] | 45 | - Supports both CUPS and LPRng as the printing system. |
---|
[1561] | 46 | |
---|
[1154] | 47 | Databases : |
---|
| 48 | |
---|
| 49 | - Supports PostgreSQL as the Quota Storage backend. |
---|
[1283] | 50 | Complete database creation script in SQL is included. |
---|
[1043] | 51 | |
---|
[1823] | 52 | - Supports any LDAP server as the Quota Storage backend. |
---|
[1475] | 53 | Complete LDAP schema and sample empty tree are included. |
---|
[1160] | 54 | Plugging PyKota into your existing LDAP infrastructure |
---|
| 55 | is really easy thanks to PyKota's great configurability. |
---|
[2051] | 56 | |
---|
| 57 | - The print jobs history can be stored in any database |
---|
| 58 | of your choice (or in plain text files) if needed. |
---|
[1160] | 59 | |
---|
[1154] | 60 | Printers : |
---|
| 61 | |
---|
[1475] | 62 | - Hardware or Software accounting methods are completely |
---|
| 63 | configurable. |
---|
| 64 | |
---|
[1154] | 65 | - Supports any printer which can report its internal |
---|
[1475] | 66 | page counter. Can ask printers for their internal |
---|
[1561] | 67 | page counter via SNMP, Netatalk, PJL, PS, or any |
---|
| 68 | other way. |
---|
[1475] | 69 | This is completely configurable. |
---|
[1154] | 70 | |
---|
[1701] | 71 | - Supports DSC compliant and binary PostScript, PDF, PCL5 (up to), |
---|
[2345] | 72 | PCLXL (aka PCL6), ESC/P2, DVI, TIFF, OpenOffice.org Writer and |
---|
[2348] | 73 | OpenOffice.org Impress printers (or virtual printers) natively |
---|
| 74 | (through the direct use of pkpgcounter's code) for software |
---|
| 75 | accounting methods. More formats to come. |
---|
[1154] | 76 | |
---|
| 77 | Quota systems : |
---|
| 78 | |
---|
[1260] | 79 | - Supports printers and printers groups quotas. |
---|
[739] | 80 | |
---|
[1260] | 81 | - Supports users and users groups quotas. |
---|
| 82 | |
---|
[1154] | 83 | - Supports page quotas. |
---|
| 84 | Page quotas can be set differently on a per printer |
---|
| 85 | and per user/group basis. |
---|
[739] | 86 | |
---|
[1154] | 87 | - Supports account balance quotas in any currency. |
---|
| 88 | Account balance quotas can be set on a per user |
---|
| 89 | basis. The account balance is shared amongst |
---|
[1561] | 90 | all printers. The history of payments (positive |
---|
| 91 | or negative credits to an user account) is kept. |
---|
[980] | 92 | |
---|
[2151] | 93 | - Supports high granularity periodic print quotas : down |
---|
| 94 | to one minute intervals if needed. |
---|
| 95 | |
---|
[1610] | 96 | - Page quotas and account balance can be set/reset |
---|
[1154] | 97 | independantly. |
---|
| 98 | |
---|
[2067] | 99 | - Page quotas can be set on a per user or per group basis |
---|
| 100 | for a particular printer. |
---|
[1154] | 101 | |
---|
| 102 | - Price per page and per job can be set differently |
---|
| 103 | on any printer. |
---|
[794] | 104 | |
---|
[1154] | 105 | - Low level of page quota or account balance are |
---|
| 106 | configurable. |
---|
[739] | 107 | |
---|
[1154] | 108 | - Both soft and hard limit with configurable grace delay |
---|
| 109 | can be set for page quota. |
---|
[900] | 110 | |
---|
[1154] | 111 | - Possibility to disable quota enforcement for any user |
---|
| 112 | or group, while still keeping page accounting. |
---|
[1928] | 113 | |
---|
[2067] | 114 | - Each user can have an overcharging (or undercharging) factor, |
---|
| 115 | which is applied whenever PyKota computes the cost of a |
---|
| 116 | print job. |
---|
| 117 | |
---|
[1154] | 118 | Administration : |
---|
| 119 | |
---|
[2067] | 120 | - Powerful delegation of administrative priviledges. |
---|
| 121 | |
---|
[1154] | 122 | - Powerful administration tools can be used to |
---|
| 123 | automate setting or resetting of quotas or |
---|
| 124 | account balances at specific intervals. |
---|
[925] | 125 | |
---|
[1154] | 126 | - Administration tools can modify several users, |
---|
[2051] | 127 | groups, or printers at once with the use of |
---|
| 128 | powerful wildcard characters. |
---|
[925] | 129 | |
---|
[1154] | 130 | - Account balances can be set, incremented, or |
---|
[1580] | 131 | decremented. History of payments is kept. |
---|
[1153] | 132 | |
---|
[2067] | 133 | - Number of pages used can be set, incremented, or |
---|
| 134 | decremented. |
---|
| 135 | |
---|
[1273] | 136 | - Both printers and users can be automatically added on |
---|
| 137 | first print in a completely configurable way. |
---|
[1154] | 138 | |
---|
| 139 | - Quota report generator available either from the |
---|
| 140 | command line or in any web browser. |
---|
| 141 | The web-based quota report generator can be |
---|
| 142 | user/password protected. |
---|
| 143 | |
---|
| 144 | - Print quote generator can tell users how much |
---|
| 145 | a print job will cost them in advance. |
---|
| 146 | |
---|
| 147 | - Policy with regard to unregistered users can |
---|
| 148 | be configured for each printer to either deny |
---|
| 149 | printing, allow printing, or delegate the |
---|
| 150 | decision to any external tool. |
---|
| 151 | |
---|
| 152 | - Warning and error messages can be automatically |
---|
[2051] | 153 | sent via email or via any other mean to the administrator, |
---|
| 154 | the user, both, or none. |
---|
[1154] | 155 | |
---|
| 156 | - Warning and error messages' content is completely |
---|
| 157 | configurable. |
---|
| 158 | |
---|
| 159 | - Configuration can be changed without needing to |
---|
| 160 | restart the printing system. |
---|
[739] | 161 | |
---|
[1154] | 162 | - Complete print job history is kept. This can be |
---|
| 163 | disabled if needed. |
---|
| 164 | |
---|
| 165 | - Automated low quota or balance remainder can be |
---|
| 166 | scheduled regularly or launched manually. |
---|
| 167 | |
---|
[2067] | 168 | - Starting and Ending personalized dynamic banners can be |
---|
| 169 | generated on the fly, and accounted for or not, depending |
---|
| 170 | on some configuration settings. |
---|
| 171 | Banners can still be enabled even if the print job is denied. |
---|
| 172 | NB : Banners are a CUPS only feature for now. |
---|
| 173 | |
---|
| 174 | - Duplicate print jobs can be forbidden automatically. |
---|
| 175 | |
---|
[1744] | 176 | - Powerful data dumper to export datas to other |
---|
[1804] | 177 | software (spreadsheets for example). Actually |
---|
| 178 | supported formats are : |
---|
[1744] | 179 | |
---|
[1804] | 180 | - Comma separated values ; |
---|
| 181 | |
---|
| 182 | - Semicolon separated values ; |
---|
| 183 | |
---|
| 184 | - Tab separated values ; |
---|
| 185 | |
---|
| 186 | - XML. |
---|
[2048] | 187 | |
---|
| 188 | - CUPS' page_log format, to easily interface in |
---|
| 189 | real time with third party apps like phpPrintAnalyzer |
---|
| 190 | and similar tools. |
---|
[1804] | 191 | |
---|
[1155] | 192 | User Interface : |
---|
| 193 | |
---|
[1154] | 194 | - All the command line tools accept the -h | --help |
---|
| 195 | command line option which prints all the available |
---|
| 196 | options and show usage examples. |
---|
[1155] | 197 | |
---|
| 198 | - Completely internationalized. Actually supports the |
---|
[2119] | 199 | English, French, Spanish, Portuguese, Brazilian, Swedish, |
---|
[2048] | 200 | Thai, Greek, German, Italian, Norwegian (Bokm�, Turkish |
---|
| 201 | and traditional Chinese languages. |
---|
[1891] | 202 | More to come. |
---|
[2048] | 203 | |
---|
[2243] | 204 | - Web enabled print quota monitor, data dumper, and quote |
---|
[2153] | 205 | generator. |
---|
[2048] | 206 | |
---|
[2049] | 207 | - An On Screen Display X-Window print quota monitor is included. |
---|
[2048] | 208 | |
---|
[2051] | 209 | - An email gateway to allow users to retrieve their print quota |
---|
| 210 | information by sending an email message to a dedicated address |
---|
| 211 | is included. |
---|
| 212 | |
---|
[2049] | 213 | - A cross-platform print quota monitor will soon be available |
---|
[2048] | 214 | as an purchaseable add-on. |
---|
[2049] | 215 | |
---|
| 216 | - Third party web based management tools are available. |
---|
[1154] | 217 | |
---|
| 218 | ==================================================================== |
---|
| 219 | |
---|
[739] | 220 | Planned features are described in the TODO file. |
---|
| 221 | |
---|
[1507] | 222 | Actually two (or an infinity of) page accounting methods are |
---|
[980] | 223 | implemented : |
---|
[695] | 224 | |
---|
[1475] | 225 | - The 'hardware' method consists in querying the printer (via SNMP |
---|
[1181] | 226 | or Netatalk or any other method of your choice) for its total pages |
---|
[1186] | 227 | counter. |
---|
[1600] | 228 | This is done both at the beginning and at the end of a |
---|
[1186] | 229 | print job. The counters difference is then immediately used to |
---|
| 230 | decrease the user's account balance or increase his quota usage. |
---|
| 231 | |
---|
[1475] | 232 | - The 'software' method consists in delegating the computation of the |
---|
[980] | 233 | job's size in number of pages to any external command of your choice. |
---|
| 234 | The command can read the job's data from its standard input and MUST |
---|
[1186] | 235 | output the job's size on its standard output. Changes to the user |
---|
[2345] | 236 | account are reported immediately. |
---|
[980] | 237 | |
---|
[2345] | 238 | PyKota featured an internal software accounting method which handles |
---|
| 239 | several Page Description Languages : DSC compliant and binary PostScript, |
---|
| 240 | PDF, PCLXL (aka PCL6), PCL3/4/5, ESC/P2, DVI, TIFF, OpenOffice.org Writer |
---|
| 241 | and OpenOffice.org Impress. This software is now distributed separately |
---|
| 242 | as 'pkpgcounter', and not included anymore in PyKota, so you must now |
---|
| 243 | download and install it before running PyKota. |
---|
| 244 | |
---|
[1600] | 245 | PyKota is known to work fine with most laser printers, either with |
---|
| 246 | software accounting, or with hardware accounting if the printer |
---|
| 247 | supports this. |
---|
[724] | 248 | |
---|
[695] | 249 | ============================================================ |
---|
| 250 | |
---|
[2001] | 251 | SUPPORT CONTRACTS: |
---|
| 252 | ================== |
---|
| 253 | |
---|
| 254 | You can now purchase 8x5x365@NextBusinessDay Technical |
---|
[2126] | 255 | Support Contracts from us. The yearly fee is computed with |
---|
| 256 | the following formula : |
---|
[2001] | 257 | |
---|
| 258 | (100.0 * NbPrintServers) + (2.5 * NbPrinters) + (0.04 * NbUsers) EUROS. |
---|
| 259 | |
---|
[2234] | 260 | This fee includes the VAT, a free subscription to official |
---|
| 261 | PyKota packages, and the latest documentation on paper. |
---|
[2001] | 262 | |
---|
| 263 | Please send an email to alet@librelogiciel.com if you're |
---|
[2126] | 264 | interested in purchasing such a contract. |
---|
[2001] | 265 | |
---|
[2126] | 266 | Remember that purchasing a support contract for Free Software like PyKota |
---|
| 267 | is a great way to show your appreciation for the work already being done |
---|
| 268 | on this project, and will help to improve this software in the future. |
---|
| 269 | |
---|
[2001] | 270 | ============================================================ |
---|
| 271 | |
---|
[695] | 272 | INSTALLATION: |
---|
| 273 | ============= |
---|
| 274 | |
---|
[1186] | 275 | NB : |
---|
| 276 | ==== |
---|
[887] | 277 | |
---|
[1397] | 278 | You may learn more about PyKota, if it fits your own organization, |
---|
| 279 | its internal working, and some potential performance drawbacks and |
---|
[2054] | 280 | how to avoid them, in a document created by Ryan Suarez at : |
---|
[1397] | 281 | |
---|
[2005] | 282 | http://archive.macosxlabs.org/forum/webcrossing_archive/documentation/Pykota_and_CUPS/Pykota_and_CUPS.html |
---|
[1034] | 283 | |
---|
[1651] | 284 | You may also find the following document interesting : |
---|
| 285 | |
---|
| 286 | http://es.tldp.org/Tutoriales/doc-openldap-samba-cups-python/ |
---|
| 287 | |
---|
| 288 | This document, written in Spanish by Sergio Gonzalez Gonzalez, |
---|
| 289 | describes the integration of PyKota into an OpenLDAP + Samba |
---|
| 290 | + CUPS installation. Even for people who can't read spanish |
---|
| 291 | this document is really interesting, and contains lots of |
---|
| 292 | screenshots. |
---|
| 293 | |
---|
[1951] | 294 | Finally, SuSe users may find the following document to best describe |
---|
| 295 | how to install PyKota on their favorite distribution. It's a Spanish |
---|
| 296 | document written by Dennis Romero : |
---|
| 297 | |
---|
| 298 | http://www.cvr.espol.edu.ec/people/dennis/Pykota1.19-SuSE9.1.pdf |
---|
| 299 | |
---|
| 300 | |
---|
[714] | 301 | Prerequisite : |
---|
| 302 | -------------- |
---|
| 303 | |
---|
| 304 | You need to have the following tools installed on the CUPS Server : |
---|
| 305 | |
---|
[1886] | 306 | - CUPS (http://www.cups.org) or LPRng (http://www.lprng.com) |
---|
| 307 | - Python v2.1 or above (http://www.python.org) |
---|
| 308 | - eGenix' mxDateTime Python extension (http://www.egenix.com) |
---|
[2345] | 309 | - The pkpgcounter command line tool, version 1.56 or higher. This |
---|
| 310 | tool is now mandatory for PyKota to work. |
---|
| 311 | (http://www.librelogiciel.com/software/) |
---|
[1771] | 312 | - The JAXML Python module to be able to dump datas in the XML format. |
---|
[1886] | 313 | (http://www.librelogiciel.com/software/) |
---|
[1771] | 314 | - The Python-SNMP module to query printers for their page counter. |
---|
[1965] | 315 | (http://pysnmp.sourceforge.net). |
---|
| 316 | IMPORTANT : version 3.4.3 (or 3.4.2) is REQUIRED. Versions 2.x or |
---|
| 317 | 4.x won't work for now. |
---|
[1771] | 318 | - The Python-OSD module to use the graphical print quota reminder. |
---|
[2189] | 319 | (http://repose.cx/pyosd/) |
---|
[1771] | 320 | - SNMP tools (specifically the snmpget command) if you prefer to |
---|
| 321 | use your own script to request query printers. |
---|
[2189] | 322 | (http://www.net-snmp.org) |
---|
[919] | 323 | - Netatalk (specifically the pap command) if you plan to |
---|
| 324 | request your printer's lifetime page counter via AppleTalk. |
---|
[1886] | 325 | (http://netatalk.sourceforge.net) |
---|
[1927] | 326 | - The ReportLab Python module (http://www.reportlab.org) if you want |
---|
| 327 | to have PyKota generate nice banners for you. |
---|
| 328 | - The Python Imaging Library (aka PIL) module |
---|
| 329 | (http://www.pythonware.com/downloads) if you want to have PyKota |
---|
| 330 | generate nice banners for you. |
---|
[1043] | 331 | - PostgreSQL's PygreSQL Python extension and the PostgreSQL client |
---|
| 332 | libraries if you plan to use PostgreSQL as the Quota Storage |
---|
| 333 | backend. |
---|
[1886] | 334 | (http://www.postgresql.org and http://www.pygreql.org) |
---|
[1043] | 335 | or |
---|
| 336 | - python-ldap Python module and the OpenLDAP client libraries |
---|
[1823] | 337 | if you plan to use an LDAP server as the Quota Storage backend. |
---|
[1886] | 338 | (http://www.openldap.org and http://python-ldap.sourceforge.net) |
---|
[714] | 339 | |
---|
[1771] | 340 | On Intel i386 architecture, and for performance reasons, it is |
---|
| 341 | strongly suggested that you install the Python accelerator Psyco, |
---|
| 342 | available at : |
---|
[1570] | 343 | |
---|
| 344 | http://psyco.sourceforge.net |
---|
| 345 | |
---|
[1571] | 346 | Under Debian : |
---|
| 347 | |
---|
| 348 | $ apt-get install python-psyco |
---|
| 349 | |
---|
| 350 | Other architectures may be supported as well in the future, check |
---|
[1600] | 351 | this on Psyco's website. |
---|
[1571] | 352 | |
---|
[1578] | 353 | Installing Psyco is not mandatory, but it will speedup PCL5 parsing |
---|
[1570] | 354 | by almost 3 times. PostScript and PDF parsing can also benefit, |
---|
| 355 | but in an almost unnoticeable manner since this part of the code |
---|
[1575] | 356 | is already optimal. For PCL5 this is a completely different matter, |
---|
[1570] | 357 | and if you install Psyco you will never regret it ! |
---|
[1600] | 358 | Same remark applies for PCL6 (aka PCLXL) : the parser is completely |
---|
| 359 | different, but the performance gain with Psyco is impressive. |
---|
[1570] | 360 | |
---|
[1186] | 361 | You may also benefit from having the following tools installed to |
---|
| 362 | deal with some printers : |
---|
| 363 | |
---|
| 364 | - npadmin |
---|
| 365 | - netcat |
---|
| 366 | - ghostscript |
---|
| 367 | |
---|
[714] | 368 | You need to have the following tools installed on the Quota Storage |
---|
| 369 | Server : |
---|
| 370 | |
---|
[1886] | 371 | - PostgreSQL (http://www.postgresql.org) |
---|
[714] | 372 | |
---|
[1043] | 373 | or |
---|
| 374 | |
---|
[1886] | 375 | - OpenLDAP, or any other LDAP server (http://www.openldap.org) |
---|
[1043] | 376 | |
---|
[1086] | 377 | NB : |
---|
| 378 | |
---|
| 379 | PygreSQL must be linked with the PostgreSQL client libraries on |
---|
| 380 | the Print Server. The PostgreSQL client libraries' version must |
---|
| 381 | match the PostgreSQL version used on the Quota Storage Server. |
---|
[714] | 382 | |
---|
[1043] | 383 | or |
---|
| 384 | |
---|
[1086] | 385 | python-ldap must be linked with the OpenLDAP client libraries on the |
---|
[1823] | 386 | Print Server. The OpenLDAP client libraries' version should match the |
---|
| 387 | OpenLDAP version used on the Quota Storage Server, if applicable. |
---|
[1043] | 388 | |
---|
[714] | 389 | This list of prerequisite software may change in the future, when |
---|
| 390 | PyKota will support more functionnalities you will be given |
---|
| 391 | alternatives. |
---|
| 392 | |
---|
[952] | 393 | Of course the Print Server and the Quota Storage Server can be the |
---|
[851] | 394 | very same machine if you've got a tiny network, or you can have |
---|
[952] | 395 | multiple Print Servers all storing their quotas on the same Quota |
---|
[851] | 396 | Storage Server if you've got a bigger network. |
---|
| 397 | |
---|
[1886] | 398 | Hint : |
---|
| 399 | ------ |
---|
| 400 | |
---|
| 401 | - The Debian GNU/Linux distribution is to our knowledge the |
---|
| 402 | easiest distribution to install PyKota on, because all |
---|
| 403 | of PyKota dependencies are already included, excepted |
---|
| 404 | for the PySNMP (http://pysnmp.sourceforge.net) module |
---|
[2345] | 405 | and the pkpgcounter utility which for now have to be downloaded |
---|
| 406 | and installed separately. |
---|
[1886] | 407 | |
---|
[714] | 408 | Then : |
---|
| 409 | ------ |
---|
| 410 | |
---|
[2135] | 411 | Download the latest PyKota version from the Subversion tree : |
---|
[695] | 412 | |
---|
[2135] | 413 | $ svn co svn://svn.librelogiciel.com/pykota/trunk pykota |
---|
[695] | 414 | |
---|
[1906] | 415 | You can now check if the dependencies are correct by typing : |
---|
[695] | 416 | |
---|
[2135] | 417 | $ python checkdeps.py |
---|
[1906] | 418 | |
---|
[2234] | 419 | An availability report for all the software needed by PyKota |
---|
| 420 | will be displayed : you'll have to install the missing |
---|
| 421 | software if you want PyKota to work correctly. |
---|
| 422 | |
---|
[1906] | 423 | To install the software, just type : |
---|
| 424 | |
---|
[2135] | 425 | $ python setup.py install |
---|
[695] | 426 | |
---|
| 427 | You may need to be logged in with sufficient privileges (e.g. root) |
---|
| 428 | |
---|
[1960] | 429 | Create a system user for PyKota : |
---|
| 430 | |
---|
[2135] | 431 | $ adduser --system --group --home /etc/pykota --gecos PyKota pykota |
---|
[1960] | 432 | |
---|
| 433 | Put the user your printing system is run as in the pykota system group : |
---|
| 434 | |
---|
[2135] | 435 | $ adduser lp pykota |
---|
[1960] | 436 | |
---|
| 437 | NB : on our system, the CUPS printing system runs as system user 'lp'. |
---|
| 438 | Please adapt this to your own system. |
---|
| 439 | |
---|
[695] | 440 | Go to the initscripts subdirectory of PyKota's sources, and choose |
---|
[1600] | 441 | the appropriate storage backend for your configuration. Read carefully |
---|
[695] | 442 | the associated README file and execute the initialization script |
---|
[878] | 443 | to create an empty PyKota Storage. Upgrade scripts may be |
---|
[2269] | 444 | provided as well. NB : if you use PostgreSQL, a good way to |
---|
| 445 | make PyKota work first time is to modify PostgreSQL's pg_hba.conf |
---|
| 446 | to allow the 'trust' database connection mode. However once PyKota |
---|
| 447 | works it is HIGHLY RECOMMENDED TO CHANGE THIS TO A MORE SECURE |
---|
| 448 | VALUE. |
---|
[695] | 449 | |
---|
[1186] | 450 | Copy the conf/pykota.conf.sample and conf/pykotadmin.conf.sample |
---|
[1107] | 451 | sample configuration files to /etc/pykota/pykota.conf and |
---|
[1905] | 452 | /etc/pykota/pykotadmin.conf |
---|
| 453 | The installation script usually copies these files into /usr/share/pykota |
---|
[1198] | 454 | |
---|
[1979] | 455 | NB : You can move PyKota's configuration files elsewhere, they will |
---|
| 456 | be searched first in user pykota's home directory. |
---|
| 457 | |
---|
[1905] | 458 | You need to adapt these files to your own needs. Especially you may |
---|
| 459 | have to create sections named after your own printers, and change |
---|
| 460 | the administrator's email address which by default is |
---|
| 461 | root@localhost. Read and try to understand these two very well |
---|
| 462 | commented files, so that you'll encounter less problems later. |
---|
| 463 | |
---|
[1198] | 464 | Also be sure to double check that commands that query printers |
---|
[1186] | 465 | for their internal page counter work from the command line |
---|
| 466 | before using them in PyKota's configuration. |
---|
[695] | 467 | |
---|
[1186] | 468 | The rest of the installation depends on your printing system : |
---|
| 469 | |
---|
[1185] | 470 | - CUPS Printing System : |
---|
[952] | 471 | |
---|
[1185] | 472 | Once and for all : |
---|
[952] | 473 | |
---|
[1185] | 474 | Create a symbolic link to the cupspykota backend |
---|
| 475 | in CUPS's backend directory : |
---|
| 476 | |
---|
| 477 | $ cd /usr/lib/cups/backend |
---|
[1345] | 478 | $ ln -s /usr/share/pykota/cupspykota cupspykota |
---|
[1185] | 479 | |
---|
| 480 | Restart CUPS so that the new backend can be detected. |
---|
| 481 | |
---|
| 482 | $ /etc/init.d/cupsys restart |
---|
| 483 | |
---|
[1600] | 484 | or : |
---|
| 485 | |
---|
[1979] | 486 | $ /etc/rc.d/init.d/cupsys restart |
---|
[1600] | 487 | |
---|
| 488 | or any similar command depending on your operating system. |
---|
| 489 | |
---|
[1185] | 490 | For new printers : |
---|
[952] | 491 | |
---|
[1185] | 492 | Go to CUPS management interface (http://localhost:631) |
---|
| 493 | and choose the appropriate PyKota managed device depending |
---|
| 494 | on the type of printer you use. For example, if your |
---|
| 495 | printer is waiting on : |
---|
| 496 | |
---|
[1354] | 497 | socket://myprinter.example.com:9100 |
---|
[1185] | 498 | |
---|
| 499 | Then choose : |
---|
| 500 | |
---|
[1354] | 501 | cupspykota:socket://myprinter.example.com:9100 |
---|
[1185] | 502 | |
---|
| 503 | Configure your printer as usual. |
---|
| 504 | |
---|
[1186] | 505 | Now double check /etc/pykota/pykota.conf |
---|
[1600] | 506 | |
---|
| 507 | You should manually create a section named after the |
---|
[1402] | 508 | printer you've just added, unless you have set |
---|
| 509 | all options globally. |
---|
[1600] | 510 | |
---|
[1408] | 511 | The new pkhint command can help you with correct settings |
---|
| 512 | for your printers, but don't rely on it because it is still |
---|
[1600] | 513 | experimental work. To use pkhint, you have to feed it with |
---|
| 514 | CUPS' printers.conf file this way : |
---|
[1186] | 515 | |
---|
[1600] | 516 | $ pkhint </etc/cups/printers.conf |
---|
| 517 | |
---|
| 518 | pkhint will try to tell you what is the best accounting |
---|
| 519 | method for each printer and will print some lines you'll |
---|
| 520 | just have to copy&paste in the appropriate sections in |
---|
| 521 | /etc/pykota/pykota.conf |
---|
| 522 | |
---|
[1185] | 523 | That's all. |
---|
[952] | 524 | |
---|
[1185] | 525 | For existing printers : |
---|
| 526 | |
---|
[1186] | 527 | If you had already installed a version of PyKota earlier |
---|
| 528 | than 1.16alpha7, then remove the *cupsFilter lines in your |
---|
[1979] | 529 | PPD files for each already managed printer. Each |
---|
[1186] | 530 | line to remove is of the form : |
---|
[1185] | 531 | |
---|
[1345] | 532 | *cupsFilter: "application/vnd.cups-postscript 0 /usr/share/pykota/pykota" |
---|
[1185] | 533 | |
---|
[1345] | 534 | This means that each time the pstops filter will be executed, it will |
---|
| 535 | pass the job's data through the pykota filter which is present in |
---|
| 536 | /usr/share/pykota |
---|
| 537 | |
---|
[1185] | 538 | Don't touch anything else, especially any other *cupsFilter line. |
---|
[1186] | 539 | Then save each of these files. |
---|
[1185] | 540 | |
---|
| 541 | Then, the easiest is to directly modify the DeviceURI lines |
---|
| 542 | in /etc/cups/printers.conf, you just have to put |
---|
| 543 | 'cupspykota:' in front of what is already on these lines. |
---|
| 544 | For example, replace : |
---|
| 545 | |
---|
[1354] | 546 | DeviceURI socket://myprinter.example.com:9100 |
---|
[1185] | 547 | |
---|
| 548 | with : |
---|
| 549 | |
---|
[1354] | 550 | DeviceURI cupspykota:socket://myprinter.example.com:9100 |
---|
[1345] | 551 | |
---|
| 552 | or : |
---|
[1185] | 553 | |
---|
[1354] | 554 | DeviceURI cupspykota://socket://myprinter.example.com:9100 |
---|
[1345] | 555 | |
---|
[1185] | 556 | Save the file and restart CUPS. |
---|
[1600] | 557 | |
---|
| 558 | Here too, you may find it interesting to use the pkhint command as |
---|
| 559 | described above to help with manual configuration of the file |
---|
| 560 | /etc/pykota/pykota.conf |
---|
[695] | 561 | |
---|
[1185] | 562 | - LPRng Printing System : |
---|
[952] | 563 | |
---|
[1600] | 564 | For each printer on which you want to use PyKota : |
---|
| 565 | |
---|
| 566 | Modify the printer's entry in /etc/printcap : you have to add |
---|
| 567 | the three following lines : |
---|
| 568 | |
---|
[1612] | 569 | :achk=true:\ |
---|
[1600] | 570 | :as=/usr/share/pykota/lprngpykota:\ |
---|
| 571 | :ae=/usr/share/pykota/lprngpykota:\ |
---|
| 572 | |
---|
| 573 | This will tell LPRng to activate accounting, and use the lprngpykota |
---|
| 574 | accounting filter both at the start and at the end of printing. |
---|
| 575 | |
---|
| 576 | When all modifications are done, just save the /etc/printcap file and |
---|
| 577 | restart LPRng : |
---|
| 578 | |
---|
| 579 | $ /etc/init.d/lprng restart |
---|
| 580 | |
---|
| 581 | or : |
---|
[1500] | 582 | |
---|
[1600] | 583 | $ /etc/rc.d/init.d/lprng restart |
---|
| 584 | |
---|
| 585 | or any similar command depending on your operating system. |
---|
| 586 | |
---|
| 587 | NB : the pkhint command can't be used with LPRng for now, so you |
---|
| 588 | have to modify /etc/pykota/pykota.conf carefully. The comments |
---|
| 589 | in this file will help you. |
---|
| 590 | |
---|
[1186] | 591 | Now you can begin to populate the PyKota's database with printers, |
---|
| 592 | users and groups : |
---|
[952] | 593 | |
---|
[716] | 594 | Add printers and users to the quota system and set their quota values : |
---|
[695] | 595 | |
---|
[1345] | 596 | Starting from version 1.18alpha2, the preferred command to manage |
---|
| 597 | printers is named pkprinters |
---|
| 598 | |
---|
| 599 | $ pkprinters --help |
---|
| 600 | |
---|
| 601 | will tell you how to create, manage or delete printers and |
---|
| 602 | printers groups. |
---|
[1402] | 603 | |
---|
| 604 | $ pkprinters --add --charge 0.05 hp2100 |
---|
| 605 | |
---|
| 606 | would add the printer named hp2100 with a price per page |
---|
| 607 | of 0.05 unit. |
---|
[1345] | 608 | |
---|
[1402] | 609 | Now set quotas for users on this printer : |
---|
| 610 | |
---|
[1086] | 611 | $ edpykota --add -P hp2100 -S 40 -H 50 user1 ... userN |
---|
[724] | 612 | |
---|
[725] | 613 | launching edpykota without any argument or with the --help |
---|
| 614 | command line option will show you all the possibilities. |
---|
[1086] | 615 | |
---|
| 616 | by default, each user is limited by "quota", this means that on |
---|
| 617 | each printer he can have a different soft and hard limit. |
---|
| 618 | You may want to limit the user by his account balance value, |
---|
[1107] | 619 | in which case, the print quota is shared between all printers |
---|
[1086] | 620 | instead of being different. To do this, use the following : |
---|
| 621 | |
---|
| 622 | $ edpykota --add -P hp2100 --limitby balance --balance 10 user1 ... userN |
---|
| 623 | |
---|
| 624 | This will put 10 $ (or Euros, PyKota doesn't care) on each user's account |
---|
| 625 | balance, and tell PyKota to limit them by their account balance value. |
---|
| 626 | Whenever they print on any printer, their account balance value is |
---|
| 627 | decreased by an amount which depends on the particular price per page |
---|
| 628 | and per job that you may have defined on the printer with edpykota's |
---|
| 629 | --charge command line option. |
---|
[1107] | 630 | Soft and Hard limits are not used if "--limitby balance" is used, |
---|
| 631 | but you can define a "poorman"'s threshold in /etc/pykota/pykota.conf |
---|
| 632 | to obtain a similar result (warning message when quota is low). |
---|
[695] | 633 | |
---|
[990] | 634 | Restart CUPS or LPRng, for example under Debian GNU/Linux systems : |
---|
[695] | 635 | |
---|
[725] | 636 | $ /etc/init.d/cupsys restart |
---|
[990] | 637 | |
---|
| 638 | or : |
---|
| 639 | |
---|
| 640 | $ /etc/init.d/lprng restart |
---|
[695] | 641 | |
---|
| 642 | Your users now should be able to print but not exceed their |
---|
| 643 | printing quota. |
---|
| 644 | |
---|
[2234] | 645 | To see printer quota usage on printer hp2100, you can use : |
---|
[794] | 646 | |
---|
[2234] | 647 | $ repykota --printer hp2100 |
---|
[794] | 648 | |
---|
| 649 | or : |
---|
| 650 | |
---|
| 651 | $ repykota |
---|
| 652 | |
---|
| 653 | which will print quota usage for all users on all printers, |
---|
[2054] | 654 | along with totals, if you are a PyKota Administator. If you are |
---|
[1107] | 655 | a regular user, only your own quota report will be produced. |
---|
[794] | 656 | |
---|
[1107] | 657 | Quota reports are also available remotely by using the CGI script |
---|
[1345] | 658 | printquota.cgi provided in the cgi-bin/ subdirectory. You can |
---|
| 659 | also use the CSS stylesheet present in the stylesheets/ subdirectory |
---|
[1402] | 660 | and put it at your web server's DocumentRoot, to benefit from a nicer |
---|
| 661 | look, especially quota violations will appear in different colors. |
---|
[990] | 662 | |
---|
[2262] | 663 | For additionnal security concerns, please give a look at the SECURITY |
---|
[980] | 664 | file which is part of this software. |
---|
[2234] | 665 | |
---|
| 666 | To diagnose a problem when something doesn't work as expected, |
---|
| 667 | please read the very first entry in the FAQ document. |
---|
[741] | 668 | |
---|
[695] | 669 | ============================================================ |
---|
| 670 | |
---|
[1979] | 671 | Additionnal tools : |
---|
| 672 | ------------------- |
---|
| 673 | |
---|
| 674 | Some people have developped tools around PyKota, and make |
---|
| 675 | them available under the GNU General Public License : |
---|
| 676 | |
---|
| 677 | - Kanakorn Horsiritham developped phpPykotaAdmin which is |
---|
[2126] | 678 | a web based database independant administrative GUI, |
---|
| 679 | written in PHP. |
---|
[1979] | 680 | |
---|
| 681 | http://opensource.psu.ac.th/~kanakorn/mambo/ |
---|
[2126] | 682 | |
---|
| 683 | He was also kind enough to write an installation guide |
---|
| 684 | in english for CUPS and PyKota with phpPykotaAdmin on Fedora |
---|
| 685 | Core 3. You'll find this document on the same website. |
---|
| 686 | |
---|
| 687 | This great software currently at version 0.3 is a wonderful |
---|
| 688 | basis for an administrative GUI since it only depends on |
---|
| 689 | PyKota commands to be present to successfully manage |
---|
| 690 | PyKota's database. |
---|
[1979] | 691 | |
---|
| 692 | Additionnal software will be listed here when they will be |
---|
| 693 | ready. |
---|
| 694 | |
---|
| 695 | ============================================================ |
---|
| 696 | |
---|
[958] | 697 | Mailing list : |
---|
| 698 | -------------- |
---|
| 699 | |
---|
| 700 | A mailing list is dedicated to Pykota, you can subscribe to it |
---|
| 701 | or consult its archives at : |
---|
| 702 | |
---|
| 703 | http://cgi.librelogiciel.com/mailman/listinfo/pykota |
---|
| 704 | |
---|
[1600] | 705 | The mailing list is the preferred way to obtain support, because |
---|
| 706 | all members can help and can also benefit from the solutions |
---|
| 707 | proposed by other members. |
---|
| 708 | |
---|
| 709 | Posts by non-members are usually rejected. |
---|
| 710 | |
---|
| 711 | The mailing list language is english and only english. |
---|
| 712 | |
---|
[1181] | 713 | IRC : |
---|
| 714 | ----- |
---|
| 715 | |
---|
| 716 | You can also chat with us : |
---|
| 717 | |
---|
| 718 | /server irc.freenode.net |
---|
| 719 | /join #pykota |
---|
[1600] | 720 | |
---|
| 721 | Preferred language on this channel is english, but french |
---|
| 722 | is also accepted. Try to avoid exposing complex problems |
---|
| 723 | in french because english speaking people on the channel |
---|
| 724 | wouldn't benefit from the solutions. |
---|
| 725 | |
---|
| 726 | PyKota's main author is known as 'tamere' on IRC. |
---|
[1181] | 727 | |
---|
[958] | 728 | ============================================================ |
---|
| 729 | |
---|
[1107] | 730 | Please e-mail bugs to the mailing list at : pykota@librelogiciel.com |
---|
| 731 | or to the main author at : alet@librelogiciel.com (Jerome Alet) |
---|