1 | # $Id$ |
---|
2 | |
---|
3 | Tea4CUPS : Tee for CUPS |
---|
4 | |
---|
5 | (c) 2005 Jerome Alet <alet@librelogiciel.com> |
---|
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. |
---|
10 | |
---|
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. |
---|
15 | |
---|
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 | |
---|
20 | ============================================================================= |
---|
21 | |
---|
22 | Tea4CUPS is the equivalent of the *nix command 'tee', but as a CUPS |
---|
23 | backend. |
---|
24 | |
---|
25 | Tea4CUPS behaves just like any other CUPS backend, but allows you to |
---|
26 | transparently send print jobs' datas to any number of outputs : other |
---|
27 | CUPS backends, files or pipes. |
---|
28 | |
---|
29 | This for example allows you to output the same print job on several |
---|
30 | printers at the same time, which is not possible with CUPS. |
---|
31 | |
---|
32 | Another possibility would be for example to send the same document to |
---|
33 | a printer, a PDF generator, a Fax, and as an attachment to an email |
---|
34 | message, all of this by printing it a single time. |
---|
35 | |
---|
36 | Tea4CUPS provides three ways to launch commands : |
---|
37 | |
---|
38 | - prehooks : these are guaranteed to be launched before the |
---|
39 | print job is sent to the real printer. |
---|
40 | Any prehook which exits -1 can cancel the |
---|
41 | print job. |
---|
42 | |
---|
43 | - tees : these are launched at the same time the job is being |
---|
44 | sent to the real printer, unless the job was |
---|
45 | previously cancelled by a prehook. |
---|
46 | |
---|
47 | - posthooks : these are guaranteed to be launched after the |
---|
48 | print job has been sent to the real printer, |
---|
49 | unless the job was previously cancelled by a |
---|
50 | prehook. |
---|
51 | |
---|
52 | To help your own commands, Tea4CUPS makes available as part of the |
---|
53 | environment several variables which can be used from the |
---|
54 | commands you use : |
---|
55 | |
---|
56 | TEAPRINTERNAME : The print queue name. |
---|
57 | TEADIRECTORY : Tea4CUPS output directory. |
---|
58 | TEADATAFILE : Full name of Tea4CUPS work file (in $TEADIRECTORY). |
---|
59 | TEAJOBSIZE : Job's size in bytes. |
---|
60 | TEAMD5SUM : MD5 sum of the job's datas. |
---|
61 | TEACLIENTHOST : Client's hostname or IP address. |
---|
62 | TEAJOBID : Job's Id. |
---|
63 | TEAUSERNAME : Name of the user who launched the print job. |
---|
64 | TEATITLE : Job's title. |
---|
65 | TEACOPIES : Number of copies requested. |
---|
66 | TEAOPTIONS : Options of the print job. |
---|
67 | TEAINPUTFILE : Print job's data file or empty when job read from stdin. |
---|
68 | TEABILLING : Job's billing code (lp -o job-billing=SomeCode file.ps) |
---|
69 | TEACONTROLFILE : Job's IPP message file (usually /var/spool/cups/c?????) |
---|
70 | TEASTATUS : Original CUPS backend's exit code : ONLY AVAILABLE FROM |
---|
71 | posthooks, obviously. |
---|
72 | |
---|
73 | In the case you want to use both Tea4CUPS and PyKota, you MUST install |
---|
74 | PyKota v1.22alpha2 or higher to avoid a race condition. |
---|
75 | |
---|
76 | NB : Tea4CUPS requires a version of Python >= 2.1 |
---|
77 | |
---|
78 | ============================================================================= |
---|
79 | |
---|
80 | Installation : |
---|
81 | -------------- |
---|
82 | |
---|
83 | 0 - Download Tea4CUPS from : |
---|
84 | |
---|
85 | http://www.librelogiciel.com/software/Tea4CUPS/action_Presentation |
---|
86 | |
---|
87 | and extract it : |
---|
88 | |
---|
89 | $ tar -zxf tea4cups-x.yy.tar.gz |
---|
90 | |
---|
91 | where x.yy is Tea4CUPS' version number. |
---|
92 | |
---|
93 | 1 - Copy the 'tea4cups' command into CUPS' backend directory, |
---|
94 | for example : |
---|
95 | |
---|
96 | $ cp tea4cups /usr/lib/cups/backend |
---|
97 | |
---|
98 | 2 - Restart CUPS in order for this new backend to be detected. |
---|
99 | |
---|
100 | 3 - Either from CUPS' web interface, add new printers with |
---|
101 | 'Tea4CUPS managed' in front of the device's name. |
---|
102 | |
---|
103 | Or by directly modifying CUPS' printers.conf file, prepend |
---|
104 | each DeviceURI value with 'tea4cups://', and restart CUPS. |
---|
105 | |
---|
106 | 4 - Copy tea4cups.conf into CUPS' configuration directory (where |
---|
107 | cupsd.conf resides) : |
---|
108 | |
---|
109 | $ cp tea4cups.conf /etc/cups/ |
---|
110 | |
---|
111 | 5 - Modify tea4cups.conf to suit your needs. Several examples |
---|
112 | are included. |
---|
113 | |
---|
114 | 6 - There's no 6 ! |
---|
115 | |
---|
116 | ============================================================================= |
---|
117 | |
---|
118 | Troubleshooting : |
---|
119 | ----------------- |
---|
120 | |
---|
121 | 1 - Set "LogLevel debug2" in CUPS' cupsd.conf |
---|
122 | |
---|
123 | 2 - Restart CUPS. |
---|
124 | |
---|
125 | 3 - Set "debug: yes" in the [global] section of tea4cups.conf |
---|
126 | |
---|
127 | 4 - Print something on a print queue managed |
---|
128 | by Tea4CUPS. |
---|
129 | |
---|
130 | 5 - Look at CUPS' error_log file for diagnostic and error messages. |
---|
131 | |
---|
132 | ============================================================================= |
---|
133 | |
---|
134 | CUPS (Common UNIX(r) Printing System) is trademark property of Easy Software |
---|
135 | Products. |
---|
136 | |
---|
137 | You can download CUPS from : |
---|
138 | |
---|
139 | http://www.cups.org |
---|
140 | |
---|
141 | ============================================================================= |
---|
142 | |
---|
143 | Please e-mail bugs to : alet@librelogiciel.com (Jerome Alet) |
---|