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