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