Changeset 3413 for pykota/trunk/README
- Timestamp:
- 09/27/08 22:02:37 (16 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/README
r3408 r3413 29 29 30 30 ==================================================================== 31 31 32 32 Planned features are described in the TODO file. 33 33 … … 36 36 37 37 - The 'hardware' method consists in querying the printer (via SNMP 38 or Netatalk or any other method of your choice) for its internal 38 or Netatalk or any other method of your choice) for its internal 39 39 pages counter. 40 40 This is done both at the beginning and at the end of a 41 print job. The counters difference is then used to 41 print job. The counters difference is then used to 42 42 decrease the user's account balance or increase his quota usage. 43 43 44 44 - The 'software' method consists in delegating the computation of the 45 45 job's size in number of pages to any external command of your choice. … … 54 54 An up-to-date list of supported Page Description Languages and their 55 55 level of support is available from : 56 56 57 57 http://www.pykota.com/software/pkpgcounter/ 58 59 - The 'ink' method consists in using pkpgcounter's code to compute 58 59 - The 'ink' method consists in using pkpgcounter's code to compute 60 60 how much of each page is covered by ink in each color of a particular 61 61 colorspace chosen between CMYK, CMY, RGB, and BW (grayscale). 62 62 These values are then summed up together and multiplied by a set 63 63 of coefficients defined in PyKota's configuration files. 64 64 65 65 PyKota is known to work with most printers, excepted GDI ones (Windows 66 66 only). At least one of the accounting methods above should work … … 75 75 76 76 You can now purchase 8x5x365@NextBusinessDay Technical 77 Support Contracts from us. The yearly fee is computed with 77 Support Contracts from us. The yearly fee is computed with 78 78 the following formula : 79 79 80 80 (100.0 * NbPrintServers) + (2.5 * NbPrinters) + (0.04 * NbUsers) EUROS. 81 81 82 82 This fee includes the VAT, and a free subscription to Official 83 83 PyKota packages. 84 84 85 85 Please send an email to alet@librelogiciel.com if you're 86 interested in purchasing such a contract. 86 interested in purchasing such a contract. 87 87 88 88 Remember that purchasing a support contract for Free Software like PyKota 89 is a great way to show your appreciation for the work already being done 89 is a great way to show your appreciation for the work already being done 90 90 on this project, and will help to improve this software in the future. 91 91 … … 104 104 have to compile it into HTML or PDF yourself by using 105 105 the appropriate tools as installed on your system. 106 106 107 107 PyKota's collaborative documentation is available from : 108 108 109 109 http://www.pykota.com/wiki/ 110 110 111 111 You may learn more about PyKota, if it fits your own organization, 112 112 its internal working, and some potential performance drawbacks and 113 113 how to avoid them, in a document created by Ryan Suarez at : 114 114 115 115 http://archive.macosxlabs.org/forum/webcrossing_archive/documentation/Pykota_and_CUPS/Pykota_and_CUPS.html 116 116 117 117 You may also find the following document interesting : 118 118 119 119 http://es.tldp.org/Tutoriales/doc-openldap-samba-cups-python/ 120 121 This document, written in Spanish by Sergio Gonzalez Gonzalez, 120 121 This document, written in Spanish by Sergio Gonzalez Gonzalez, 122 122 describes the integration of PyKota into an OpenLDAP + Samba 123 + CUPS installation. Even for people who can't read spanish 123 + CUPS installation. Even for people who can't read spanish 124 124 this document is really interesting, and contains lots of 125 125 screenshots. 126 127 128 Prerequisite : 126 127 128 Prerequisite : 129 129 -------------- 130 130 131 131 See : 132 132 133 133 http://www.pykota.com/wiki/Dependencies 134 134 135 135 for an up-to-date list, or see below (maybe not up-to-date) : 136 136 137 137 You need to have the following tools installed on the CUPS Server : 138 138 139 139 - CUPS (http://www.cups.org). PyKota v1.27 requires CUPS v1.3.4 or higher. 140 140 - Python v2.3 or higher (http://www.python.org) 141 141 - eGenix' mxDateTime Python extension (http://www.egenix.com) 142 142 - The pkpgcounter command line tool, version 1.56 or higher. This 143 tool is now mandatory for PyKota to work. 143 tool is now mandatory for PyKota to work. 144 144 (http://www.pykota.com/software/pkpgcounter) 145 - The pkipplib Python library (http://www.pykota.com/software/pkipplib) 145 - The pkipplib Python library (http://www.pykota.com/software/pkipplib) 146 146 - The JAXML Python module to be able to dump datas in the XML format. 147 147 (http://www.librelogiciel.com/software/) 148 - The Python-PAM module if you need the pknotify command to be able 148 - The Python-PAM module if you need the pknotify command to be able 149 149 to check usernames and passwords. (http://www.pangalactic.org/PyPAM) 150 150 - The Python-SNMP module to query printers for their page counter. 151 (http://pysnmp.sourceforge.net) 151 (http://pysnmp.sourceforge.net) 152 152 IMPORTANT : version 3.4.2 or higher is REQUIRED. 153 153 Versions 2.x won't work. Versions 4.x now work (tested with v4.1.5a). … … 161 161 request your printer's lifetime page counter via AppleTalk. 162 162 (http://netatalk.sourceforge.net) 163 - The ReportLab Python module (http://www.reportlab.org) if you want 163 - The ReportLab Python module (http://www.reportlab.org) if you want 164 164 to have PyKota generate nice banners for you. 165 - The Python Imaging Library (aka PIL) module 166 (http://www.pythonware.com/downloads) if you want to have PyKota 165 - The Python Imaging Library (aka PIL) module 166 (http://www.pythonware.com/downloads) if you want to have PyKota 167 167 generate nice banners for you. 168 168 - PostgreSQL's PygreSQL Python extension and the PostgreSQL client 169 169 libraries if you plan to use PostgreSQL as the database backend. 170 170 (http://www.postgresql.org and http://www.pygreql.org) 171 or 172 - python-ldap Python module and the OpenLDAP client libraries 171 or 172 - python-ldap Python module and the OpenLDAP client libraries 173 173 if you plan to use an LDAP server as the database backend. 174 174 (http://www.openldap.org and http://python-ldap.sourceforge.net) 175 or 175 or 176 176 - SQLite v3.2.7 and the SQLite libraries if you plan to use SQLite 177 as the database backend (http://www.sqlite.org). You also need the 177 as the database backend (http://www.sqlite.org). You also need the 178 178 PySQLite module v2.0.5 or higher (http://www.pysqlite.org) 179 179 or 180 - The MySQL-python bindings. 181 IMPORTANT: If you are using MySQL 4.1, then MySQL-python must be 180 - The MySQL-python bindings. 181 IMPORTANT: If you are using MySQL 4.1, then MySQL-python must be 182 182 version 1.2 or greater. Version 1.0 does not work correctly with 4.1. 183 184 183 184 185 185 On Intel i386 architecture, and for performance reasons, it is 186 186 suggested that you install the Python accelerator Psyco, available from : 187 187 188 188 http://psyco.sourceforge.net 189 190 Under Debian : 191 189 190 Under Debian : 191 192 192 $ apt-get install python-psyco 193 194 Other architectures may be supported as well in the future, check 193 194 Other architectures may be supported as well in the future, check 195 195 this on Psyco's website. 196 197 Installing Psyco is not mandatory, but may really speed the parsing 196 197 Installing Psyco is not mandatory, but may really speed the parsing 198 198 of some print jobs. 199 199 200 200 You need to have the following tools installed on the database 201 201 server : 202 202 203 203 - PostgreSQL (http://www.postgresql.org) 204 205 or 206 204 205 or 206 207 207 - OpenLDAP, or any other LDAP server (http://www.openldap.org) 208 209 or 210 208 209 or 210 211 211 - SQLite, v3.2.7 or higher (http://www.sqlite.org). 212 212 Beware : with SQLite the database server and the print 213 213 servers MUST be the very same machine. 214 215 or 216 214 215 or 216 217 217 - MySQL 4.1 or higher. 5.x is recommended. 218 218 219 219 This list of prerequisite software may change in the future, when 220 PyKota will support more functionnalities you will be given 220 PyKota will support more functionnalities you will be given 221 221 alternatives. 222 223 Of course the Print Server and the database server can be the 224 very same machine if you've got a tiny network, or you can have 222 223 Of course the Print Server and the database server can be the 224 very same machine if you've got a tiny network, or you can have 225 225 multiple Print Servers all storing their quotas on the same database 226 226 server if you've got a bigger network. (NB : with SQLite, the database 227 227 can't be shared between several print servers) 228 229 Hint : 228 229 Hint : 230 230 ------ 231 231 232 - The Debian GNU/Linux distribution is to our knowledge the 232 - The Debian GNU/Linux distribution is to our knowledge the 233 233 easiest distribution to install PyKota on, because almost all 234 234 of PyKota dependencies are already included. … … 238 238 manually. 239 239 240 Then : 240 Then : 241 241 ------ 242 242 243 243 Download the latest PyKota version from the Subversion tree : 244 244 … … 248 248 249 249 $ python checkdeps.py 250 250 251 251 An availability report for all the software needed by PyKota 252 252 will be displayed : you'll have to install the missing 253 253 software if you want PyKota to work correctly. 254 254 255 255 To install the software, just type : 256 256 … … 263 263 264 264 $ pksetup debian 265 266 or : 265 266 or : 267 267 268 268 $ pksetup ubuntu 269 269 270 270 and follow the instructions to install PyKota in interactive mode, then 271 271 skip the remaining of the section below. … … 276 276 277 277 $ adduser --system --group --home /etc/pykota --gecos PyKota pykota 278 278 279 279 Put the user your printing system is run as in the pykota system group : 280 280 281 281 $ adduser lp pykota 282 282 283 283 NB : on our system, the CUPS printing system runs as system user 'lp'. 284 284 Please adapt this to your own system. … … 289 289 change the passwords, or, in the case of the LDAP backend, adapt it 290 290 to your own LDAP DIT, and execute the initialization script 291 to create an empty PyKota database. Upgrade scripts may be 291 to create an empty PyKota database. Upgrade scripts may be 292 292 provided as well. NB : if you use PostgreSQL, a good way to 293 293 make PyKota work first time is to modify PostgreSQL's pg_hba.conf … … 297 297 and PostgreSQL's documentation for details on this subject. 298 298 299 Copy the conf/pykota.conf.sample and conf/pykotadmin.conf.sample 300 sample configuration files to ~pykota/pykota.conf and 301 ~pykota/pykotadmin.conf 299 Copy the conf/pykota.conf.sample and conf/pykotadmin.conf.sample 300 sample configuration files to ~pykota/pykota.conf and 301 ~pykota/pykotadmin.conf 302 302 The installation script usually copies these files into /usr/share/pykota 303 303 … … 305 305 be searched first in user pykota's home directory, then in /etc/pykota. 306 306 307 You need to adapt these files to your own needs. Especially you may 308 have to create sections named after your own printers, and change 309 the administrator's email address which by default is 310 root@localhost. Read and try to understand these two very well 311 commented files, so that you'll encounter less problems later. 307 You need to adapt these files to your own needs. Especially you may 308 have to create sections named after your own printers, and change 309 the administrator's email address which by default is 310 root@localhost. Read and try to understand these two very well 311 commented files, so that you'll encounter less problems later. 312 312 313 313 The rest of the installation depends on your printing system : 314 314 315 315 - CUPS Printing System : 316 316 317 317 Once and for all : 318 318 319 319 Modify CUPS' cupsd.conf to make CUPS listen to 127.0.0.1:631 320 320 INSTEAD OF to an unix domain socket, in addition to any 321 321 external network interface CUPS might already be listening to. 322 323 Create a symbolic link to the cupspykota backend 322 323 Create a symbolic link to the cupspykota backend 324 324 in CUPS's backend directory : 325 325 326 326 $ cd /usr/lib/cups/backend 327 327 $ ln -s /usr/share/pykota/cupspykota cupspykota 328 329 If you use CUPS v1.2 or higher, please do this as well : 330 328 329 If you use CUPS v1.2 or higher, please do this as well : 330 331 331 $ chmod 700 /usr/share/pykota/cupspykota 332 332 333 333 This allows the cupspykota backend to support other 334 334 backends which must be run as user root, like the 335 335 lpd backend for example. 336 336 337 337 Restart CUPS so that the new backend can be detected. 338 338 339 339 $ /etc/init.d/cupsys restart 340 341 for example under Debian, or any similar command depending 340 341 for example under Debian, or any similar command depending 342 342 on your operating system of choice. 343 343 344 344 For new printers : 345 346 Go to CUPS management interface (http://localhost:631) 345 346 Go to CUPS management interface (http://localhost:631) 347 347 and choose the appropriate PyKota managed device depending 348 348 on the type of printer you use. For example, if your 349 349 printer is waiting on : 350 350 351 351 socket://myprinter.example.com:9100 352 353 Then choose : 354 352 353 Then choose : 354 355 355 cupspykota:socket://myprinter.example.com:9100 356 357 Configure your printer as usual. 358 359 Now double check /etc/pykota/pykota.conf 360 356 357 Configure your printer as usual. 358 359 Now double check /etc/pykota/pykota.conf 360 361 361 You should manually create a section named after the 362 362 printer you've just added, unless you have set 363 363 all options globally. 364 365 The new pkturnkey command can help you with correct settings 364 365 The new pkturnkey command can help you with correct settings 366 366 for your printers. To have pkturnkey give you some hints 367 367 about what to put into pykota.conf for a particular 368 368 print queue, just use its --doconf command line switch : 369 369 370 370 $ pkturnkey --doconf TheNameOfThePrintQueue 371 371 372 372 pkturnkey will try to tell you what is the best accounting 373 373 method for each printer and will print some lines you'll 374 374 just have to copy&paste in the appropriate sections in 375 375 /etc/pykota/pykota.conf 376 376 377 377 For more informations about what pkturnkey can do for you, 378 378 see pkturnkey's manual page or use the --help command 379 379 line switch : 380 380 381 381 $ pkturnkey --help | less 382 382 383 383 That's all. 384 384 385 385 For existing print queues : 386 386 387 387 You want to route the print queue through PyKota, 388 388 and you can do this in several manners. 389 389 390 390 $ pkprinters --add --cups TheNameOfThePrintQueue 391 392 or 393 391 392 or 393 394 394 if your printer's DeviceURI is something like : 395 395 396 396 socket://myprinter.example.com:9100 397 398 then you can do this : 399 397 398 then you can do this : 399 400 400 $ pkprinters --add TheNameOfThePrintQueue 401 401 $ lpadmin -p TheNameOfThePrintQueue \ 402 402 -v cupspykota://socket://myprinter.example.com:9100 403 404 Finally, you could do it manually by modifying the 403 404 Finally, you could do it manually by modifying the 405 405 the DeviceURI lines in /etc/cups/printers.conf : 406 You would have to preprend 'cupspykota://' in front 406 You would have to preprend 'cupspykota://' in front 407 407 of what is already on these lines. For example, replace : 408 408 409 409 DeviceURI socket://myprinter.example.com:9100 410 411 with : 412 410 411 with : 412 413 413 DeviceURI cupspykota://socket://myprinter.example.com:9100 414 415 or : 416 414 415 or : 416 417 417 DeviceURI cupspykota://socket://myprinter.example.com:9100 418 418 419 419 Save the file and restart CUPS for the changes to take effect. 420 420 421 421 Here too, you may find it interesting to use the pkturnkey command as 422 422 described above to help with manual configuration of the file … … 425 425 Now you can begin to populate the PyKota's database with printers, 426 426 users and groups : 427 428 Add printers and users to the quota system and set their quota values : 427 428 Add printers and users to the quota system and set their quota values : 429 429 430 430 You can either use pkturnkey, or do the same things manually by … … 434 434 435 435 $ pkprinters --help 436 436 437 437 will tell you how to create, manage or delete printers and 438 438 printers groups. 439 439 440 440 $ pkprinters --add --charge 0.05 hp2100 441 441 442 442 would add the printer named hp2100 with a price per page 443 443 of 0.05 unit. … … 446 446 447 447 $ pkusers --add --limitby balance --balance 10.0 jerome 448 448 449 449 would create user jerome and give him ten credits to spend 450 450 on any printer. 451 451 452 452 Finally create print quota entries : 453 453 454 454 $ edpykota --add --printer hp2100 john paul george ringo 455 456 This will create print quota entries for The Beatles on 455 456 This will create print quota entries for The Beatles on 457 457 printer hp2100. The print quota entry holds the number of 458 458 pages printed on a particular printer for a particular … … 460 460 of balance limits. See pkusers and edpykota's manual 461 461 pages for details. 462 463 Your users now should be able to print but not exceed their 462 463 Your users now should be able to print but not exceed their 464 464 printing quota. 465 465 … … 467 467 468 468 $ repykota --printer hp2100 469 469 470 470 or : 471 471 472 472 $ repykota 473 473 474 474 which will print quota usage for all users on all printers, 475 475 along with totals, if you are a PyKota Administator. If you are 476 476 a regular user, only your own quota report will be produced. 477 478 You can also use these commands : 479 480 $ pkusers --list 477 478 You can also use these commands : 479 480 $ pkusers --list 481 481 $ edpykota --list 482 482 483 483 $ pkusers --list john paul george ringo 484 484 $ edpykota --list --printer hp2100 john paul george ringo 485 485 486 486 Quota reports are also available remotely by using the CGI script 487 printquota.cgi provided in the cgi-bin/ subdirectory. You can 487 printquota.cgi provided in the cgi-bin/ subdirectory. You can 488 488 also use the CSS stylesheet present in the stylesheets/ subdirectory 489 and put it at your web server's DocumentRoot, to benefit from a nicer 489 and put it at your web server's DocumentRoot, to benefit from a nicer 490 490 look, especially quota violations will appear in different colors. 491 491 … … 497 497 498 498 http://otrs.librelogiciel.com/otrs/public.pl?ID=2 499 499 500 500 ============================================================ 501 501 … … 505 505 A mailing list is dedicated to PyKota, you can subscribe to it 506 506 or consult its archives at : 507 507 508 508 http://lists.pykota.com/mailman/listinfo/pykota 509 510 This mailing list is the preferred way to obtain support, because 509 510 This mailing list is the preferred way to obtain support, because 511 511 all members can help and can also benefit from the solutions 512 proposed by other members. 513 512 proposed by other members. 513 514 514 Another mailing list, dedicated to developers, is available from : 515 515 516 516 http://lists.pykota.com/mailman/listinfo/pykota-devel 517 518 In this mailing list you can discuss implementation details, bugs, 517 518 In this mailing list you can discuss implementation details, bugs, 519 519 ideas, and so on. All commit messages are also sent to this list. 520 520 521 521 Posts by non-members are rejected. 522 522 523 523 The mailing lists language is english and only english. 524 525 IRC : 524 525 IRC : 526 526 ----- 527 527 528 528 You can also chat with us : 529 529 530 530 /server irc.freenode.net 531 531 /join #pykota 532 533 Preferred language on this channel is english, but french 532 533 Preferred language on this channel is english, but french 534 534 is also accepted. Try to avoid exposing complex problems 535 535 in french because english speaking people on the channel 536 536 wouldn't benefit from the solutions. 537 537 538 538 PyKota's main author is known as 'tamere' on IRC. 539 540 Bug Tracker : 539 540 Bug Tracker : 541 541 ------------- 542 542 543 543 You can report bugs to our bug tracker on the development website 544 544 at : 545 545 546 546 http://trac.pykota.com 547 547