1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
---|
2 | <HTML> |
---|
3 | <HEAD> |
---|
4 | <TITLE> LPRng-HOWTO: Installing the programs</TITLE> |
---|
5 | </HEAD> |
---|
6 | <BODY> |
---|
7 | <A HREF="LPRng-HOWTO-5.html">Next</A> |
---|
8 | <A HREF="LPRng-HOWTO-3.html">Previous</A> |
---|
9 | <A HREF="LPRng-HOWTO.html#toc4">Contents</A> |
---|
10 | <HR> |
---|
11 | <H2><A NAME="s4">4. Installing the programs</A></H2> |
---|
12 | |
---|
13 | <P>The basic components of the LPRng system are the executables |
---|
14 | and the database files. |
---|
15 | This section deals with generating and installing the executable |
---|
16 | files. |
---|
17 | <H2><A NAME="ss4.1">4.1 Files and Setup</A> |
---|
18 | </H2> |
---|
19 | |
---|
20 | <P>The LPRng system can run in several different manners. |
---|
21 | However, |
---|
22 | for most users it will require the executables |
---|
23 | for the server <CODE>lpd</CODE>, and the client applications for |
---|
24 | job submission - <CODE>lpr</CODE>, |
---|
25 | job status - <CODE>lpq</CODE>, |
---|
26 | job removal - <CODE>lprm</CODE>, |
---|
27 | and server management - <CODE>lprc</CODE>, |
---|
28 | and the <CODE>/etc/lpd.conf</CODE> |
---|
29 | and <CODE>/etc/printcap</CODE> files. |
---|
30 | <P>By default, |
---|
31 | all the LPRng executables are installed in |
---|
32 | <CODE>/usr/local/bin</CODE>, |
---|
33 | which differs from other UNIX lpr systems, |
---|
34 | which scatter them in various hidden and arcane locations. Note that the |
---|
35 | original printing system executables will need to be renamed or removed after |
---|
36 | installing LPRng. |
---|
37 | <P>The |
---|
38 | <CODE> |
---|
39 | <A HREF="LPRng-HOWTO-7.html#lpdconf">/etc/lpd.conf</A></CODE> |
---|
40 | file contains the configuration |
---|
41 | information for the server and application programs. |
---|
42 | The LPRng system has a compiled in set of defaults that should be |
---|
43 | suitable for most user applications. |
---|
44 | In fact, the default |
---|
45 | <CODE>/etc/lpd.conf</CODE> does not override any of the precompiled values. |
---|
46 | <P>The |
---|
47 | <CODE> |
---|
48 | <A HREF="#printcapref">/etc/printcap</A></CODE> |
---|
49 | file contains the printer database information. |
---|
50 | This information can override the defaults in |
---|
51 | <CODE>/etc/lpd.conf</CODE> |
---|
52 | <H2><A NAME="ss4.2">4.2 Source Code and Installation</A> |
---|
53 | </H2> |
---|
54 | |
---|
55 | <P>If you have a binary distribution, you can skip this section. However, |
---|
56 | since LPRng is a rapidly evolving package, I would advise you to check |
---|
57 | whether there is a newer stable version available on one of the |
---|
58 | <A HREF="LPRng-HOWTO-1.html#secftp">FTP sites.</A> |
---|
59 | There should be a link to this stable version called |
---|
60 | <CODE>LPRng-stable.tar.gz</CODE>. |
---|
61 | <P>You should also look at the |
---|
62 | <A HREF="#sysdep">System specific notes</A> |
---|
63 | to see if there are any special things that you need to do for your system. |
---|
64 | <H3>Building the software</H3> |
---|
65 | |
---|
66 | <P>Before you start to build the software, |
---|
67 | you should read the |
---|
68 | <CODE>README.1st</CODE> and <CODE>README.installation</CODE> |
---|
69 | files in the distribution. |
---|
70 | If you have GNU Make, do: |
---|
71 | <PRE> |
---|
72 | ./configure; |
---|
73 | #if you want internationalization, |
---|
74 | # ./configure --enable-nls |
---|
75 | make clean all; |
---|
76 | su # you must do the following commands as root |
---|
77 | make install |
---|
78 | # if you have not installed LPRng before, |
---|
79 | # install default lpd.perms and lpd.conf file in /etc |
---|
80 | if [ ! -f /etc/lpd.perms ]; then |
---|
81 | make default; |
---|
82 | fi; |
---|
83 | # update permissions, create files needed for LPRng, check |
---|
84 | # /etc/printcap file for problems. Do as root: |
---|
85 | ./src/checkpc -f |
---|
86 | </PRE> |
---|
87 | <P>If you have BSD make do: |
---|
88 | <PRE> |
---|
89 | ./configure; |
---|
90 | #if you want internationalization, |
---|
91 | # ./configure --enable-nls |
---|
92 | make -f Makefile.bsd clean all; |
---|
93 | su # you must do the following commands as root |
---|
94 | make -f Makefile.bsd install |
---|
95 | # if you have not installed LPRng before, |
---|
96 | # install default lpd.perms and lpd.conf file in /etc |
---|
97 | if [ ! -f /etc/lpd.perms ]; then |
---|
98 | make -f Makefile.bsd default; |
---|
99 | fi; |
---|
100 | # update permissions, create files needed for LPRng, check |
---|
101 | # /etc/printcap file for problems. Do as root: |
---|
102 | ./src/checkpc -f |
---|
103 | </PRE> |
---|
104 | <P>Use the configure |
---|
105 | <CODE>--bindir</CODE> option to specify |
---|
106 | the location of the binaries, |
---|
107 | or edit <CODE>src/Makefile</CODE> or |
---|
108 | <CODE>src/Makefile.bsd</CODE> |
---|
109 | after running configure. |
---|
110 | The lines you have to change are: |
---|
111 | <PRE> |
---|
112 | INSTALL_BIN = ${exec_prefix}/bin |
---|
113 | # where daemons are installed: lpd |
---|
114 | #INSTALL_LIB = ${prefix}/lib |
---|
115 | INSTALL_LIB = ${prefix}/sbin |
---|
116 | # where maintenance commands are installed: checkpc, setstatus |
---|
117 | INSTALL_MAINT = ${exec_prefix}/sbin |
---|
118 | </PRE> |
---|
119 | <P>By default, all LPRng executables are placed in |
---|
120 | <CODE>/usr/local/bin.</CODE> |
---|
121 | <H3>Problems with compilation</H3> |
---|
122 | |
---|
123 | <P>If you have problems compiling the package, you can try these things: |
---|
124 | <OL> |
---|
125 | <LI>Try <CODE>gcc</CODE> instead of your vendor's C compiler. |
---|
126 | This is the standard compiler used for LPRng. |
---|
127 | Almost without exception, |
---|
128 | if you have a ANSI C compatible compiler and libraries |
---|
129 | a POSIX compatible standard set of system support routines, |
---|
130 | LPRng will compile and run out of the box. |
---|
131 | The main problems are with missing or modified system support routines, |
---|
132 | but configure will usually detect this and set flags to use |
---|
133 | suitable alternatives.</LI> |
---|
134 | <LI>The <CODE>configure</CODE> and the <CODE>make</CODE> should be run on |
---|
135 | the target host, |
---|
136 | especially if the target host has a different version of the operating system. |
---|
137 | This is extremely important for SunOS or Solaris, |
---|
138 | where |
---|
139 | there tend to be changes in the system's include files between |
---|
140 | versions |
---|
141 | as well as support libraries.</LI> |
---|
142 | <LI><CODE>configure</CODE> |
---|
143 | and the LPRng software tends to make the assumption that newer versions will not |
---|
144 | have the same problems that older versions have had.</LI> |
---|
145 | </OL> |
---|
146 | <P>If you are not familiar with GNU configure, read the file |
---|
147 | <CODE>INSTALL</CODE> for instructions. |
---|
148 | <P>Also read the notes for your OS in section |
---|
149 | <A HREF="#sysdep">System-dependent notes</A> |
---|
150 | for specific installation help (if any). |
---|
151 | <A NAME="installation"></A> <H2><A NAME="ss4.3">4.3 Preparing to run the daemon</A> |
---|
152 | </H2> |
---|
153 | |
---|
154 | <P>Don't be too impatient. Take your time to completely read through this |
---|
155 | HOWTO. Things will be a lot easier when you first set up the |
---|
156 | configuration files, and then start the new lpd. |
---|
157 | <P>During the course of these steps, you will have to change some files. |
---|
158 | Be sure to keep a copy of the original file(s)! |
---|
159 | <H3>Removing Existing Facilities</H3> |
---|
160 | |
---|
161 | <P>Here is a summary and some scripts |
---|
162 | to help you prepare your site for |
---|
163 | running the server. |
---|
164 | <OL> |
---|
165 | <LI>Kill off the old server. |
---|
166 | <PRE> |
---|
167 | BSD or Linux: |
---|
168 | ps -aux |grep lpd |
---|
169 | kill (pid of lpd server) |
---|
170 | System V: |
---|
171 | ps -ea |grep lpsched |
---|
172 | kill (pid of lpsched server) |
---|
173 | </PRE> |
---|
174 | </LI> |
---|
175 | <LI>You should remove or rename the existing print system executables. |
---|
176 | Use the following script and |
---|
177 | examine the <CODE>/tmp/candidates</CODE> file for possible programs. |
---|
178 | Remove or rename the non-LPRng versions of the programs. |
---|
179 | <PRE> |
---|
180 | # you might want to track down the old lpr, lpq, lprm binaries |
---|
181 | find /usr -type file -name lp\* \; -print >/tmp/candidates |
---|
182 | find /sbin -type file -name lp\* \; -print >>/tmp/candidates |
---|
183 | |
---|
184 | # example rename |
---|
185 | mv /usr/libexec/lpd /usr/libexec/lpd.orig |
---|
186 | # example link |
---|
187 | ln -s /usr/local/bin/lpd /usr/libexec/lpd |
---|
188 | </PRE> |
---|
189 | </LI> |
---|
190 | <LI>Try starting and running <CODE>lpd</CODE> before permanently installing it. |
---|
191 | You should do the next steps as <B>root</B>. |
---|
192 | <PRE> |
---|
193 | /usr/local/bin/lpd; # start up LPD |
---|
194 | lpq; # test it with LPQ |
---|
195 | </PRE> |
---|
196 | </LI> |
---|
197 | </OL> |
---|
198 | |
---|
199 | <A NAME="startup"></A> <H3>Startup Scripts</H3> |
---|
200 | |
---|
201 | <P>Don't forget to modify your system print startup files, |
---|
202 | i.e. - the <CODE>/etc/rc</CODE> file in most BSD based UNIX systems, |
---|
203 | or those in <CODE>/etc/init.d</CODE> or <CODE>/sbin/init.d</CODE> on System V and Linux. |
---|
204 | You will need to have them reference the LPRng <CODE>lpd</CODE> |
---|
205 | and not the original system executable. For systems that use the System V |
---|
206 | run-level scripts, you will also likely need to install a symbolic link in the |
---|
207 | default system run-level directory (perhaps <CODE>/etc/rc3.d</CODE> or |
---|
208 | <CODE>/sbin/rc3.d</CODE>) pointing to the master copy of the startup script in the |
---|
209 | <CODE>init.d</CODE> directory. |
---|
210 | <P>Here is the core of a typical UNIX SystemV or LINUX startup file |
---|
211 | that can be used to start up and shut down the server. |
---|
212 | Note that you will most likely need to modify the |
---|
213 | <CODE>echo</CODE> lines. |
---|
214 | <PRE> |
---|
215 | #!/bin/sh |
---|
216 | case "$1" in |
---|
217 | start) # Start daemons. |
---|
218 | echo "Starting lpd: \c"; /usr/local/bin/lpd; bin/echo; |
---|
219 | ;; |
---|
220 | stop) # Stop daemons. |
---|
221 | echo "Shutting down lpd: \c" |
---|
222 | server=`/usr/local/bin/lpc -Pany@localhost lpd \ |
---|
223 | | awk '{for(i=1;i<=NF;++i){v=$i+0;if(v>1){ print v;exit;}}}'` |
---|
224 | if [ -n "$server" ]; then |
---|
225 | echo " server pid $server"; |
---|
226 | kill $server; |
---|
227 | else |
---|
228 | echo " no server active"; |
---|
229 | fi; |
---|
230 | ;; |
---|
231 | *) |
---|
232 | echo "Usage: lpd {start|stop}" |
---|
233 | exit 1 |
---|
234 | ;; |
---|
235 | esac |
---|
236 | </PRE> |
---|
237 | |
---|
238 | <A NAME="lpsimulation"></A> <H2><A NAME="ss4.4">4.4 Replacing UNIX SystemV lp, lpstat Printing Services</A> |
---|
239 | </H2> |
---|
240 | |
---|
241 | <P>Many UNIX utilities in the Solaris and HP UNIX environment use the |
---|
242 | UNIX System V <CODE>lp</CODE> and <CODE>lpstat</CODE> |
---|
243 | programs. |
---|
244 | It is almost impossible to modify their operation to use the |
---|
245 | LPRng <CODE>lpr</CODE> or <CODE>lpq</CODE> programs, |
---|
246 | as they depend on various return codes and information. |
---|
247 | <P>Here are Patrick Powell's comments on this: |
---|
248 | <BLOCKQUOTE> |
---|
249 | After fighting with LP simulation, I finally decided to make the |
---|
250 | interface part of the LPR/LPQ package. If LPR is invoked as LP, |
---|
251 | then it will 'act' like a 'semi-compatible' LP; similarly for LPQ and LPSTAT, |
---|
252 | and LPRM and CANCEL. |
---|
253 | </BLOCKQUOTE> |
---|
254 | <P>To get this functionality, you need to either make a symbolic link |
---|
255 | or a hard link to the appropriate executable. |
---|
256 | <PRE> |
---|
257 | cd /usr/local/bin |
---|
258 | ln -s lpr lp |
---|
259 | ln -s lpq lpstat |
---|
260 | ln -s lprm cancel |
---|
261 | cd /usr/sbin |
---|
262 | ln -s /usr/local/bin/lpr lp |
---|
263 | ln -s /usr/local/bin/lpq lpstat |
---|
264 | ln -s /usr/local/bin/lprm cancel |
---|
265 | </PRE> |
---|
266 | <P>See the man pages for lp, lpstat, and cancel in the LPRng/man directory. |
---|
267 | Note that not all the functions of the original |
---|
268 | lp programs are supported. |
---|
269 | These man pages should be installed to replace the normal |
---|
270 | lp, etc, man pages. |
---|
271 | <P>For some purposes, the rather rugged <CODE>lpstat</CODE> |
---|
272 | simulation provided by this method does not work. |
---|
273 | <A HREF="mailto:garrett@qualcomm.com">Garrett D'Amore <garrett@qualcomm.com></A> |
---|
274 | has written some much improved versions; |
---|
275 | take a look at |
---|
276 | <A HREF="http://people.qualcomm.com/garrett/">http://people.qualcomm.com/garrett/</A> |
---|
277 | for details. |
---|
278 | <A NAME="user"></A> |
---|
279 | <A NAME="group"></A> <H2><A NAME="ss4.5">4.5 Setuid ROOT and Security Issues</A> |
---|
280 | </H2> |
---|
281 | |
---|
282 | <P>By default, |
---|
283 | LPRng executables are installed setuid ROOT. |
---|
284 | When running, |
---|
285 | they normally perform all operations with the user's effective UID, |
---|
286 | and perform all other operations set to the user and group specified by the |
---|
287 | <CODE>user=daemon</CODE> |
---|
288 | and |
---|
289 | <CODE>group=daemon</CODE> |
---|
290 | printcap entries, |
---|
291 | except for a very few places where they take extreme precautions against |
---|
292 | actions that could cause security breaches, |
---|
293 | change the EUID to ROOT, |
---|
294 | and then immediately change back to the normal operation. |
---|
295 | <P>As a scan of the various CERT Security Advisories will indicate, |
---|
296 | many programs that run SUID root can be serious security loopholes. |
---|
297 | While LPRng has been designed and implemented with security and |
---|
298 | paranoia in mind, |
---|
299 | there is still the possibility that user level or LPD processes |
---|
300 | can have an exposed security loophole. |
---|
301 | <P>To reduce the risk, |
---|
302 | the user level utilities such as lpr, lprm, lpq, and lpc can be installed |
---|
303 | non-setuid. |
---|
304 | This effectively closes several possible security loopholes. |
---|
305 | To install the executables as non-setuid, |
---|
306 | the distribution <CODE>src/Makefile</CODE> |
---|
307 | must have the following lines commented out, |
---|
308 | and then LPRng must be reinstalled: |
---|
309 | <PRE> |
---|
310 | edit src/Makefile |
---|
311 | # comment out the next line to have LPRng installed non-setuid |
---|
312 | PERMS=$(SUID_ROOT_PERMS) |
---|
313 | make install |
---|
314 | </PRE> |
---|
315 | |
---|
316 | <A NAME="sysdep"></A> <H2><A NAME="ss4.6">4.6 System specific notes</A> |
---|
317 | </H2> |
---|
318 | |
---|
319 | <P>The following are a set of suggestions and recommendations for |
---|
320 | specific systems. |
---|
321 | <A NAME="solarisinstall"></A> <H2><A NAME="ss4.7">4.7 Solaris 2.4, 2.5, 2.6</A> |
---|
322 | </H2> |
---|
323 | |
---|
324 | <P>The Sun Solaris operating system is derived from the System V UNIX |
---|
325 | baseline. |
---|
326 | Use the following installation procedure. |
---|
327 | <OL> |
---|
328 | <LI>First, |
---|
329 | install the LPRng software |
---|
330 | and then rename all of the existing Solaris print facilities. |
---|
331 | See the |
---|
332 | <A HREF="#installation">Installation</A> section for details. |
---|
333 | You should especially look out for |
---|
334 | <CODE>lp</CODE>, |
---|
335 | <CODE>lpstat</CODE>, |
---|
336 | <CODE>lpsched</CODE>, |
---|
337 | <CODE>lpadmin</CODE>, |
---|
338 | and other executables used by Solaris for print support.</LI> |
---|
339 | <LI>Next, |
---|
340 | make sure you update the <CODE>/etc/rc</CODE> startup files. |
---|
341 | During the startup or initialization, |
---|
342 | Solaris will invoke a set of individual startup files. |
---|
343 | You will find that the startupfile files are usually links to a |
---|
344 | common one in the <CODE>/etc/init.d</CODE> directory. |
---|
345 | <PRE> |
---|
346 | ># grep -l lpsched /etc/rc* /etc/rc*/* init.d/* init.d/*/* |
---|
347 | /etc/rc0.d/K20lp |
---|
348 | /etc/rc2.d/K20lp |
---|
349 | /etc/rc2.d/S80lp |
---|
350 | /etc/init.d/lp |
---|
351 | ># ls -l /etc/rc0.d/K20lp |
---|
352 | lrwxrwxr-x 1 root bin 1 Dec 29 23:39 /etc/rc0.d/K20lp -> ../../init.d/lp |
---|
353 | </PRE> |
---|
354 | </LI> |
---|
355 | <LI>Replace the existing lp startup file with one similar to the |
---|
356 | <A HREF="#startup">startup script</A> in the previous section.</LI> |
---|
357 | <LI>Check the <CODE>/etc/inetd.conf</CODE> file for a line like: |
---|
358 | <PRE> |
---|
359 | printer stream tcp nowait root /usr/lib/print/in.lpd in.lpd |
---|
360 | </PRE> |
---|
361 | |
---|
362 | <P>and remove it if it is present. |
---|
363 | </LI> |
---|
364 | <LI><EM>Reboot</EM>. |
---|
365 | Don't try to be fancy and kill off processes, |
---|
366 | use the <EM>nlsadmin</EM> command, |
---|
367 | or other insanity. |
---|
368 | This is brutal, but appears to be necessary in order to ensure |
---|
369 | that the networking support is set up correctly.</LI> |
---|
370 | <LI>When the system restarts, try using <CODE>lpq</CODE> |
---|
371 | to check to see if the <CODE>lpd</CODE> server is active.</LI> |
---|
372 | </OL> |
---|
373 | <P>James P. Dugal <CODE><jpd@usl.ed></CODE> has also makde the following |
---|
374 | suggestions as well. |
---|
375 | <PRE> |
---|
376 | From: "Dugal James P." <jpd@usl.edu> |
---|
377 | To: lprng@iona.com |
---|
378 | Subject: Re: [LPRng] start up trouble |
---|
379 | |
---|
380 | Here are some more tips for Solaris: |
---|
381 | |
---|
382 | 1. If /var/spool/cron/crontabs/lp exists, remove it. |
---|
383 | |
---|
384 | In fact, we actually test if /etc/init.d/lp exists on any newly-installed |
---|
385 | system, and if so, we issue these commands: |
---|
386 | /etc/init.d/lp stop |
---|
387 | /usr/sbin/pkgrm -n SUNWpsu |
---|
388 | /usr/sbin/pkgrm -n SUNWscplp |
---|
389 | /usr/sbin/pkgrm -n SUNWpcu |
---|
390 | /usr/sbin/pkgrm -n SUNWpsr |
---|
391 | /usr/sbin/pkgrm -n SUNWpcr |
---|
392 | /bin/rm -f /var/spool/cron/crontabs/lp |
---|
393 | |
---|
394 | Regards, |
---|
395 | -- James Dugal, N5KNX Internet: jpd@usl.edu |
---|
396 | Associate Director Ham packet: n5knx@k5arh.#lft.la.usa.noam |
---|
397 | Computing Support Services US Mail: PO Box 42770 Lafayette, LA 70504 |
---|
398 | University of Southwestern LA. Tel. 318-482-6417 U.S.A. |
---|
399 | </PRE> |
---|
400 | <P> |
---|
401 | <H2><A NAME="ss4.8">4.8 Solaris, Newsprint and FrameMaker</A> |
---|
402 | </H2> |
---|
403 | |
---|
404 | <P>The following is a guide to using LPRng and |
---|
405 | Sun Microsystems Newsprint by |
---|
406 | Christopher Hylands, Ptolemy Project Manager |
---|
407 | of the University of California. |
---|
408 | <P>The Sun Newsprint printer is actually |
---|
409 | an OEM version of the Textronix PhaserII; |
---|
410 | Sun Microsystems appears to have dropped support for Newsprint, |
---|
411 | and the recommended migration path is to buy a PostScript printer. |
---|
412 | If you want more information on using the Newsprint system, |
---|
413 | notes are available via |
---|
414 | <CODE>http://ptolemy.eecs.berkeley.edu/~cxh/lprng.html</CODE>. |
---|
415 | <P>Looking through the mailing list logs, it looks like everyone was |
---|
416 | having a hard time getting lprng to work with Sun's braindead |
---|
417 | newsprinters. I tried using ghostscript, but the fonts were, IMHO, |
---|
418 | ugly, so I spent a little time getting the newsprint fonts to work. |
---|
419 | <P>The key thing was to grab the file |
---|
420 | <CODE>/usr/newsprint/lpd/if</CODE> |
---|
421 | from a SunOS4.1.3 newsprint installation. |
---|
422 | If you cannot get this code, |
---|
423 | then the installation will be extremely difficult. |
---|
424 | <P>To install lprng on a Solaris2.x machine, |
---|
425 | you need to first stop the existing print services and install the |
---|
426 | startup scripts for LPRng. |
---|
427 | Note that if there is a local printer, you may have |
---|
428 | to also fix the permissions of the device. Typical commands are: |
---|
429 | <PRE> |
---|
430 | chown daemon /devices/sbus@1,f8000000/SUNW,lpvi@1,300000:lpvi0 |
---|
431 | </PRE> |
---|
432 | <P>We use the following simple <CODE>if</CODE> script. |
---|
433 | <PRE> |
---|
434 | #/bin/sh |
---|
435 | # extremely simple filter script |
---|
436 | /bin/cat |
---|
437 | </PRE> |
---|
438 | <P>The Sparcprinters use licensed fonts from NeWSprint. To use the |
---|
439 | licensed fonts, you must have the lprng spool directory for the |
---|
440 | sparcprinter in the same location as spool directory of the brain |
---|
441 | dead Solaris lp system. If your printer is named xsp524, then this |
---|
442 | directory would be <CODE> /etc/lp/printers/xsp524</CODE>. |
---|
443 | <P>The printcap entry looks like: |
---|
444 | <PRE> |
---|
445 | sp524|524: |
---|
446 | :mx#0:sf:sh:sb: |
---|
447 | :lp=:rm=doppler:rp=xsp524:mx#0: |
---|
448 | :sd=/var/spool/lpd/sp524d: |
---|
449 | :lf=/var/spool/lpd/sp524d/log: |
---|
450 | xsp524|Sun SPARCprinter NeWSprint printer: |
---|
451 | :mx#0:sf:sb:sh:rs: |
---|
452 | :lp=/dev/lpvi0: |
---|
453 | :sd=/etc/lp/printers/xsp524: |
---|
454 | :lf=/etc/lp/printers/xsp524/log: |
---|
455 | :af=/var/spool/lpd/xsp524/acct: |
---|
456 | :if=/usr/local/lib/newsprint/if: |
---|
457 | </PRE> |
---|
458 | <P>The |
---|
459 | <CODE>/usr/local/lib/newsprint/if</CODE> |
---|
460 | was copied from |
---|
461 | <CODE>/usr/newsprint/lpd/if</CODE> |
---|
462 | in a SunOS4.x installation of the newsprint |
---|
463 | software. |
---|
464 | Unfortunately, the newsprint engine is so brain dead that it |
---|
465 | needs many environment variables set, so it is fairly difficult to |
---|
466 | come up with a clean script to start the engine. I made the following |
---|
467 | changes to the file. |
---|
468 | <OL> |
---|
469 | <LI>First, set the path in the script. |
---|
470 | You may also need to change defaults to suit your preferences: |
---|
471 | <PRE> |
---|
472 | PATH=/usr/ucb:/usr/bin:/etc:/usr/etc:/opt/NeWSprint/bin:/opt/NeWSprint/np/bin: |
---|
473 | PATH=$PATH:$NPHOME/pl.$ARCH/bin:$NPHOME/np/bin; export PATH |
---|
474 | </PRE> |
---|
475 | </LI> |
---|
476 | <LI>You will also need a |
---|
477 | <CODE>/etc/lp/printers/printername/.params</CODE> |
---|
478 | file. If you |
---|
479 | are using the same spooler directory as the directory that the Solaris |
---|
480 | lp system uses, then the .param file should appear there. If you are |
---|
481 | using a different spooler directory, then you will need to copy |
---|
482 | the .param file from elsewhere and edit it accordingly.</LI> |
---|
483 | <LI>If you are going to move a license to a new printer, you should |
---|
484 | probably save the .param file in the old printer spooler directory. |
---|
485 | Run /opt/NeWSprint/bin/fp_install and remove the license from the |
---|
486 | old printer and assign it to the new printer. |
---|
487 | You could run /opt/NeWSprint/bin/rm_np_printer and remove the printer, |
---|
488 | but that will get rid of the .param file</LI> |
---|
489 | <LI>FrameMaker under Solaris2.x uses the lp command. The fix is to edit |
---|
490 | $FMHOME/fminit/FMlpr and comment out the lp line and add an lpr line |
---|
491 | <PRE> |
---|
492 | sunxm.s5.sparc) |
---|
493 | lpr -P"$PRINTER" "$FILE" |
---|
494 | #lp -c -d"$PRINTER" "$FILE" |
---|
495 | </PRE> |
---|
496 | </LI> |
---|
497 | </OL> |
---|
498 | |
---|
499 | <PRE> |
---|
500 | Christopher Hylands, Ptolemy Project Manager University of California |
---|
501 | cxh@eecs.berkeley.edu US Mail: 558 Cory Hall #1770 |
---|
502 | ph: (510)643-9841 fax:(510)642-2739 Berkeley, CA 94720-1770 |
---|
503 | home: (510)526-4010 (if busy -4068) (Office: 493 Cory) |
---|
504 | </PRE> |
---|
505 | <H2><A NAME="ss4.9">4.9 Linux</A> |
---|
506 | </H2> |
---|
507 | |
---|
508 | <P>At the time of this writing (Jan 1998), |
---|
509 | the three major Linux |
---|
510 | distributions (Slackware, Red Hat and Debian) carry an older version |
---|
511 | of LPRng. Users of those systems should download the |
---|
512 | latest stable release, and install that instead of the distributed |
---|
513 | binaries. |
---|
514 | <P>This is mostly important for Slackware 3.2 users, as this version |
---|
515 | installs LPRng by default. |
---|
516 | Patrick Volkerding changed the default back to |
---|
517 | BSD LPR in Slackware 3.3, |
---|
518 | as many users had experienced problems |
---|
519 | because they didn't realize they weren't using the BSD software. |
---|
520 | <P>Debian's <CODE>dselect</CODE> utility lets you choose between all |
---|
521 | packages. Amongst these are LPRng, as well as the traditional LPR |
---|
522 | software. |
---|
523 | <P>You have to make sure your kernel is configured correctly. The |
---|
524 | documentation for the kernel sources in |
---|
525 | <CODE>/usr/src/linux/Documentation/</CODE> and the <CODE>Kernel-HOWTO</CODE> |
---|
526 | will help you to generate a new kernel if needed. You will need to set |
---|
527 | the following options: |
---|
528 | <UL> |
---|
529 | <LI>Networking support (<CODE>CONFIG_NET</CODE>)</LI> |
---|
530 | <LI>TCP/IP support (<CODE>CONFIG_INET</CODE>)</LI> |
---|
531 | <LI>If your printer is connected to a parallel port, you will also |
---|
532 | need the `Parallel Printer Support' (<CODE>CONFIG_PRINTER</CODE>). |
---|
533 | You can use this as a module if you want.</LI> |
---|
534 | <LI>For a serial printer, answer `Yes' when asked if you want |
---|
535 | `Support for serial devices' (<CODE>CONFIG_SERIAL</CODE>). This is |
---|
536 | also available as a module.</LI> |
---|
537 | </UL> |
---|
538 | <P>Once you have done this, |
---|
539 | the current releases of LPRng will install and run without |
---|
540 | problems. |
---|
541 | See the |
---|
542 | <A HREF="LPRng-HOWTO-3.html#installingprograms">Installing the programs</A> |
---|
543 | section for details on how to install LPRng and |
---|
544 | deactivate the existing print support. |
---|
545 | <P>You may need to update the printcap file and filters. |
---|
546 | See |
---|
547 | <A HREF="#printcapref">/etc/printcap Print Spool Database File</A> |
---|
548 | for details. |
---|
549 | <H2><A NAME="ss4.10">4.10 AIX</A> |
---|
550 | </H2> |
---|
551 | |
---|
552 | <P>This information was supplied by |
---|
553 | <A HREF="mailto:nitschke@math.unihamburg.de">Dirk Nitschke</A>, |
---|
554 | as of August 1997, |
---|
555 | and describes how to install the LPRng package on a workstation |
---|
556 | running AIX 4.1.x and possibly 3.x.x as well. |
---|
557 | Dirk would be interested in any comments or corrections. |
---|
558 | <P>Printing on AIX systems is different. AIX provides a general |
---|
559 | queueing facility and printing is only one way to use it. You submit a |
---|
560 | print job to a print queue using one of the commands |
---|
561 | <CODE>qprt</CODE>, <CODE>enq</CODE>. You can use the BSD or |
---|
562 | System V printing commands <CODE>lpr</CODE> or <CODE>lp</CODE>, too. The |
---|
563 | qdaemon watches all (general) queues and knows how to handle your |
---|
564 | job. A (general) queue is defined in the file |
---|
565 | <CODE>/etc/qconfig</CODE>. The format of this file is different from |
---|
566 | the <CODE>printcap</CODE> format. |
---|
567 | <P>OK, how to replace the AIX printing system? There is no group |
---|
568 | <CODE>daemon</CODE> on AIX. Therefore you have to change the default |
---|
569 | group for file ownership and process permissions. We decided to use |
---|
570 | the <CODE>printq</CODE> group. The user <CODE>daemon</CODE> exists on |
---|
571 | AIX but we have chosen <CODE>lpd</CODE> as the user who runs |
---|
572 | <CODE>lpd</CODE> and all filters and owns the spooling directories. |
---|
573 | You can change the values for <CODE>group</CODE>, |
---|
574 | <CODE>server_user</CODE> and <CODE>user</CODE> in your |
---|
575 | <CODE>lpd.conf</CODE> file or in the sources |
---|
576 | <CODE>src/common/default.c</CODE>. This is an example for |
---|
577 | <CODE>lpd.conf</CODE>: |
---|
578 | <PRE> |
---|
579 | # lpd.conf for AIX (change group, server_user and user) |
---|
580 | group=printq |
---|
581 | server_user=lpd |
---|
582 | user=lpd |
---|
583 | </PRE> |
---|
584 | |
---|
585 | Compile and install the LPRng package. Create your |
---|
586 | <CODE>printcap</CODE>, spooling directories, accounting and logfiles |
---|
587 | and so on. |
---|
588 | Don't forget to use |
---|
589 | <A HREF="LPRng-HOWTO-10.html#checkpc">checkpc</A> to make sure that all the |
---|
590 | permissions are set correctly and the necessary files |
---|
591 | are created. |
---|
592 | <P>Then stop all print queues defined on your workstation. Use |
---|
593 | <PRE> |
---|
594 | # chque -q queuename -a "up = FALSE" |
---|
595 | </PRE> |
---|
596 | |
---|
597 | for this (yes, blanks around <CODE>=</CODE> are needed). |
---|
598 | <P>If you have local printers attached to your system you will have an |
---|
599 | <CODE>lpd</CODE> running. Stop this daemon using SMIT (Print Spooling, |
---|
600 | Manage Print Server, Stop the Print Server Subsystem). Choosing |
---|
601 | <CODE>both</CODE> also removes <CODE>lpd</CODE> from |
---|
602 | <CODE>/etc/inittab</CODE>. Maybe it's faster to do this by hand: |
---|
603 | <PRE> |
---|
604 | # stopsrc -p'pid of /usr/sbin/lpd' |
---|
605 | # rmitab "lpd" |
---|
606 | </PRE> |
---|
607 | <P>Now delete all print queues (managed by qdaemon) defined on your |
---|
608 | system. You can use SMIT for this or the commands |
---|
609 | <CODE>{mk,ch,rm}que</CODE>, <CODE>{mk,ch,rm}quedev</CODE>, |
---|
610 | <CODE>{mk,ch,rm}virprt</CODE>. The SMIT fast path is <CODE>smit |
---|
611 | rmpq</CODE>. |
---|
612 | <P>To start the new <CODE>lpd</CODE> at system startup you have to add |
---|
613 | an entry to <CODE>/etc/inittab</CODE>: |
---|
614 | <PRE> |
---|
615 | # mkitab "lpd:2:once:/full/path/lpd" |
---|
616 | </PRE> |
---|
617 | <P>Some work has to be done if have have a local printer attached to |
---|
618 | your workstation. You have to create a device file like |
---|
619 | <CODE>/dev/lp0</CODE>. The SMIT fast path for this is <CODE>smit |
---|
620 | mkdev</CODE>. Choose <CODE>Printer/Plotter</CODE> and then |
---|
621 | <CODE>Printer/Plotter Devices</CODE>. Now <CODE>Add a |
---|
622 | Printer/Plotter</CODE>. To create a parallel |
---|
623 | printer device select the following: |
---|
624 | <PRE> |
---|
625 | Plotter type: opp Other parallel printer |
---|
626 | Printer/Plotter Interface: parallel |
---|
627 | Parent Adapter: ppa0 Available |
---|
628 | </PRE> |
---|
629 | |
---|
630 | Now define the characteristictics of the device: |
---|
631 | <PRE> |
---|
632 | Port Number: p |
---|
633 | </PRE> |
---|
634 | |
---|
635 | (<CODE>p</CODE> is for parallel). |
---|
636 | Go to the field |
---|
637 | <PRE> |
---|
638 | Send all characters to printer UNMODIFIED no |
---|
639 | </PRE> |
---|
640 | |
---|
641 | and select <CODE>yes</CODE>! We have had a lot of trouble with |
---|
642 | <CODE>no</CODE>. This is very important! Expect erroneous output if |
---|
643 | you choose <CODE>no</CODE>. If you have already created a device |
---|
644 | file, change the characteristictics! SMIT's fast path is <CODE>smit |
---|
645 | chdev</CODE>. |
---|
646 | <P>Finally remove all AIX printing commands like <CODE>qprt</CODE>, |
---|
647 | <CODE>lp</CODE>, <CODE>cancel</CODE>, <CODE>lpr</CODE>, |
---|
648 | <CODE>lprm</CODE>. You will find a lot of them in |
---|
649 | <CODE>/usr/bin</CODE>. Do not remove <CODE>enq</CODE> and friends if |
---|
650 | you want to use the general queueing facility. |
---|
651 | <P>Now you can start your new <CODE>lpd</CODE>. |
---|
652 | <H2><A NAME="ss4.11">4.11 Appletalk Support</A> |
---|
653 | </H2> |
---|
654 | |
---|
655 | <P>Netatalk is used to communicate from TCP/IP to |
---|
656 | Appletalk printers and vice versa. |
---|
657 | The netalk distribution FAQ is at: |
---|
658 | <P> |
---|
659 | <A HREF="http://www.umich.edu/~rsug/netatalk">http://www.umich.edu/~rsug/netatalk</A><P>There are two issues with using netatalk. The first issue |
---|
660 | has to do with printing to LPRng-served printers from Macs. |
---|
661 | The second issue has to do with printing from LPRng to |
---|
662 | network printers that speak AppleTalk. |
---|
663 | <P> |
---|
664 | <H2><A NAME="ss4.12">4.12 Apple to LPRng Printing</A> |
---|
665 | </H2> |
---|
666 | |
---|
667 | <P>After you have installed and gotten netatalk working, |
---|
668 | you can use the following configuration file to print |
---|
669 | from a Macintosh to an LPRng printer. |
---|
670 | <PRE> |
---|
671 | From edan@mtu.edu Mon Sep 29 21:31:25 1997 |
---|
672 | Date: Tue, 30 Sep 1997 00:04:58 -0400 (EDT) |
---|
673 | From: Edan Idzerda <edan@mtu.edu> |
---|
674 | To: lprng@iona.com |
---|
675 | Subject: Re: [LPRng] Netatalk configuration file |
---|
676 | > Somebody posted a very nice Netatalk papd.conf file |
---|
677 | > that showed the setup for LPRng. If anybody has this |
---|
678 | > handy could you post it? |
---|
679 | Well, *I* use: |
---|
680 | Your 32 Character Printer Name:\ |
---|
681 | :pr=|/your/path/to/lpr -Pprintername |
---|
682 | :ppd=/your/path/to/ppd/files/yourprinter.ppd |
---|
683 | -- |
---|
684 | Edan Idzerda <edan@mtu.edu> |
---|
685 | System Administrator -- Michigan Technological University, Houghton MI USA |
---|
686 | </PRE> |
---|
687 | <H2><A NAME="ss4.13">4.13 LPRng to Appletalk Printing</A> |
---|
688 | </H2> |
---|
689 | |
---|
690 | <P>The netatalk package comes with a PostScript filter called <CODE>psf</CODE>. After |
---|
691 | compilation, it is in (e.g.) <CODE>netatalk-1.4b2/etc/psf</CODE> and will be installed |
---|
692 | in (e.g.) <CODE>/usr/local/atalk/etc/</CODE>. After installation, there will also |
---|
693 | be a directory <CODE>/usr/local/atalk/etc/filters</CODE> that contains |
---|
694 | <CODE>ifpap</CODE>, <CODE>ofpap</CODE>, |
---|
695 | et al. These are just symlinks to <CODE>psf</CODE>, and <CODE>psf</CODE> will do the appropriate |
---|
696 | thing based on how it was invoked. If there's a 'pap' in the name, |
---|
697 | <CODE>psf</CODE> uses AppleTalk to talk to the printer. See psf(8) for more information. |
---|
698 | <P>A printcap entry for a network printer looks like the following: |
---|
699 | <PRE> |
---|
700 | dave|Dave's 32 Character Printer Name:\ |
---|
701 | :sd=/var/spool/dave:\ |
---|
702 | :lf=/var/adm/lpd-errs:\ |
---|
703 | :lo=lock:\ |
---|
704 | :if=/usr/local/atalk/etc/filters/ifpap:\ |
---|
705 | :of=/usr/local/atalk/etc/filters/ofpap:\ |
---|
706 | :lp=/var/spool/dave/null |
---|
707 | </PRE> |
---|
708 | <P>There are three caveats to using netatalk this way. |
---|
709 | <OL> |
---|
710 | <LI>The first is that |
---|
711 | <CODE>psf</CODE> (i.e., the filters) needs to run as root. You can accomplish this |
---|
712 | in one of two ways. The first is to uncomment the following line in |
---|
713 | src/Makefile and recompile: |
---|
714 | <PRE> |
---|
715 | # ROOT_CFLAG=-DROOT_PERMS_TO_FILTER_SECURITY_LOOPHOLE |
---|
716 | </PRE> |
---|
717 | |
---|
718 | <P>The filter lines then need to look like the following: |
---|
719 | <PRE> |
---|
720 | :if=ROOT /usr/local/atalk/etc/filters/ifpap:\ |
---|
721 | :of=ROOT /usr/local/atalk/etc/filters/ofpap:\ |
---|
722 | </PRE> |
---|
723 | <P>The alternative is to make <CODE>psf</CODE> setuid root. To minimize the risk, |
---|
724 | you may want to make <CODE>psf</CODE> executable only by group <CODE>daemon</CODE>. |
---|
725 | (I haven't tested the first option. I'm currently using the second option.) |
---|
726 | <P> |
---|
727 | </LI> |
---|
728 | <LI>The second caveat is that each network printer needs a <CODE>.paprc</CODE> in its |
---|
729 | spool directory. For instance, <CODE>/var/spool/dave/.paprc</CODE> looks like this: |
---|
730 | <PRE> |
---|
731 | Dave's 32 Character Printer Name:LaserWriter@Your AppleTalk Zone |
---|
732 | </PRE> |
---|
733 | |
---|
734 | <P>See psf(8) and pap(1) for more information. |
---|
735 | <P> |
---|
736 | </LI> |
---|
737 | <LI>The third caveat concerns the lp line in the printcap entry. For a |
---|
738 | single printer, this can be <CODE>/dev/null</CODE>. If the host spools to more |
---|
739 | than one AppleTalk printer, you shouldn't use <CODE>/dev/null</CODE> for lp. You |
---|
740 | should use <CODE>mknod</CODE> to create a null device for each printer. See psf(8).</LI> |
---|
741 | </OL> |
---|
742 | |
---|
743 | <PRE> |
---|
744 | Chad Mynhier <mynhier@cs.utk.edu> |
---|
745 | Lab Engineer, CS Department |
---|
746 | University of Tennessee, Knoxville |
---|
747 | </PRE> |
---|
748 | <H2><A NAME="ss4.14">4.14 SAMBA Support</A> |
---|
749 | </H2> |
---|
750 | |
---|
751 | <P>From the |
---|
752 | <A HREF="http://samba.canberra.edu.au/pub/samba/">http://samba.canberra.edu.au/pub/samba/</A> |
---|
753 | Web Site. |
---|
754 | <P> |
---|
755 | <H3>What is SMB</H3> |
---|
756 | |
---|
757 | <P>This is a big question. |
---|
758 | <P>The very short answer is that it is the protocol by which a lot of |
---|
759 | PC-related machines share files and printers and other information |
---|
760 | such as lists of available files and printers. Operating systems that |
---|
761 | support this natively include Windows NT, OS/2, and Linux and add on |
---|
762 | packages that achieve the same thing are available for DOS, Windows, |
---|
763 | VMS, Unix of all kinds, MVS, and more. There is no reason why Apple |
---|
764 | Macs and indeed any Web browser should not be able to speak this |
---|
765 | protocol, and current development (in which the Samba team is heavily |
---|
766 | involved) is aimed at exactly that. Alternatives to SMB include |
---|
767 | Netware, NFS, Appletalk, Banyan Vines, Decnet etc; many of these have |
---|
768 | advantages but none are both public specifications and widely |
---|
769 | implemented in desktop machines by default. |
---|
770 | <P>The Common Internet Filesystem is what the new SMB initiative is |
---|
771 | called. For details watch |
---|
772 | <A HREF="http://samba.anu.edu.au/cifs">http://samba.anu.edu.au/cifs</A>. |
---|
773 | <P><B>WHAT CAN SAMBA DO?</B> |
---|
774 | <P>Here is a very short list of what samba includes, and what it does. |
---|
775 | <UL> |
---|
776 | <LI> a SMB server, to provide Windows NT and LAN Manager-style file and print |
---|
777 | services to SMB clients such as Windows 95, Warp Server, smbfs and others.</LI> |
---|
778 | <LI> a Netbios (rfc1001/1002) nameserver, which among other things gives |
---|
779 | browsing support. Samba can be the master browser on your LAN if you wish.</LI> |
---|
780 | <LI> a ftp-like SMB client so you can access PC resources (disks and |
---|
781 | printers) from unix, Netware and other operating systems</LI> |
---|
782 | <LI> a tar extension to the client for backing up PCs</LI> |
---|
783 | </UL> |
---|
784 | <P>For a much better overview have a look at the web site at |
---|
785 | <A HREF="http://samba.canberra.edu.au/pub/samba">http://samba.canberra.edu.au/pub/samba</A> |
---|
786 | and browse the user survey. |
---|
787 | <P>Related packages include: |
---|
788 | <UL> |
---|
789 | <LI> smbfs, a linux-only filesystem allowing you to mount remote SMB |
---|
790 | filesystems from PCs on your linux box. This is included as standard with |
---|
791 | Linux 2.0 and later.</LI> |
---|
792 | <LI> tcpdump-smb, a extension to tcpdump to allow you to investigate SMB |
---|
793 | networking problems over netbeui and tcp/ip.</LI> |
---|
794 | <LI> smblib, a library of smb functions which are designed to make it |
---|
795 | easy to smb-ise any particular application. See |
---|
796 | ftp://samba.anu.edu.au/pub/samba/smblib.</LI> |
---|
797 | </UL> |
---|
798 | <P><B>FTP SITE</B> |
---|
799 | <P>The main anonymous ftp distribution site for this software is |
---|
800 | samba.anu.edu.au in the directory pub/samba/. |
---|
801 | <B>WEB SITE</B> |
---|
802 | <P>A Samba WWW site has been setup with lots of useful info. Connect to: |
---|
803 | <P> |
---|
804 | <A HREF="http://samba.canberra.edu.au/pub/samba/">http://samba.canberra.edu.au/pub/samba/</A><P>As well as general information and documentation, this also has searchable |
---|
805 | archives of the mailing list and a user survey that shows who else is using |
---|
806 | this package. Have you registered with the survey yet? :-) |
---|
807 | <P>It is maintained by Paul Blackman (thanks Paul!). You can contact him |
---|
808 | at ictinus@lake.canberra.edu.au. |
---|
809 | <H3>Samba and LPRng</H3> |
---|
810 | |
---|
811 | <P>The SAMBA code is very easy to configure. See the SAMBA |
---|
812 | documentation for details, but you only need to modify |
---|
813 | the samba.conf file and put in the pathnames of the LPRng |
---|
814 | facilities. The following is a sample. |
---|
815 | <P> |
---|
816 | <PRE> |
---|
817 | From: Sascha Ottolski <alzhimer@cs.tu-berlin.de> |
---|
818 | To: lprng@iona.com |
---|
819 | Subject: Re: [LPRng] lprng-3.2.6 and smb on Linux |
---|
820 | webnut@conc.tds.net said: |
---|
821 | |
---|
822 | I have samba sending print from Win95 machines to LPRng. The key to |
---|
823 | making it work is in the samba.conf file in the [global] section: |
---|
824 | |
---|
825 | [global] |
---|
826 | printing = lprng |
---|
827 | print command = /usr/local/bin/lpr -P%p %s -r |
---|
828 | lpq command = /usr/local/bin/lpq -P%p |
---|
829 | lprm command = /usr/local/bin/lprm -P%p %j |
---|
830 | printcap name = /etc/printcap |
---|
831 | load printers = no |
---|
832 | [printers] |
---|
833 | comment = All Printers |
---|
834 | path = /tmp |
---|
835 | browseable = no |
---|
836 | printable = yes |
---|
837 | guest ok = no |
---|
838 | writable = no |
---|
839 | create mode = 0700 |
---|
840 | |
---|
841 | Note: the path= value specifies the spool directory where |
---|
842 | the print files are temporarily stored. This should NOT |
---|
843 | be the LPRng spool directory, but some other directory that |
---|
844 | Samba has write permissions for. |
---|
845 | </PRE> |
---|
846 | |
---|
847 | <PRE> |
---|
848 | Reply-To: "Pascal A. Dupuis" <dupuis@lei.ucl.ac.be> |
---|
849 | To: papowell@astart2.astart.com |
---|
850 | Subject: Re: LPRng-3.2.10 |
---|
851 | </PRE> |
---|
852 | <P>I include the smbprint script used to send stdin to a NetBEUI printer. |
---|
853 | <PRE> |
---|
854 | #!/bin/sh -x |
---|
855 | # This script is an input filter for printcap printing on a unix machine. It |
---|
856 | # uses the smbclient program to print the file to the specified smb-based |
---|
857 | # server and service. |
---|
858 | # For example you could have a printcap entry like this |
---|
859 | # |
---|
860 | # smb:lp=/dev/null:sd=/usr/spool/smb:sh:if=/usr/local/samba/smbprint |
---|
861 | # |
---|
862 | # which would create a unix printer called "smb" that will print via this |
---|
863 | # script. You will need to create the spool directory /usr/spool/smb with |
---|
864 | # appropriate permissions and ownerships for your system. |
---|
865 | # |
---|
866 | # The /usr/spool/smb/.config file should contain: |
---|
867 | # server=PC_SERVER |
---|
868 | # service=PR_SHARENAME |
---|
869 | # password="password" |
---|
870 | # |
---|
871 | # Set these to the server and service you wish to print to |
---|
872 | # In this example I have a WfWg PC called "lapland" that has a printer |
---|
873 | # exported called "printer" with no password. |
---|
874 | # |
---|
875 | # E.g. |
---|
876 | # server=PAULS_PC |
---|
877 | # service=CJET_371 |
---|
878 | # password="" |
---|
879 | # Should read the following variables set in the config file: |
---|
880 | # server, service, password |
---|
881 | config_file=.config |
---|
882 | eval `cat $config_file` |
---|
883 | # echo "server $server, service $service" 2>&1 |
---|
884 | ( |
---|
885 | # NOTE You may wish to add the line `echo translate' if you want automatic |
---|
886 | # CR/LF translation when printing. |
---|
887 | # echo translate |
---|
888 | echo "print -" |
---|
889 | cat |
---|
890 | ) | /usr/local/bin/smbclient "\\\\$server\\$service" \ |
---|
891 | $password -U $server -N -P |
---|
892 | # comment preceeding line and uncomment following |
---|
893 | # to just test for correct filter working |
---|
894 | #) | cat > /dev/null |
---|
895 | </PRE> |
---|
896 | |
---|
897 | <A NAME="printspec"></A> <H2><A NAME="ss4.15">4.15 Printer Specific notes</A> |
---|
898 | </H2> |
---|
899 | |
---|
900 | <P>This is a small collection of miscellaneous notes about printers |
---|
901 | and applications. |
---|
902 | <H2><A NAME="ss4.16">4.16 HP Deskjet</A> |
---|
903 | </H2> |
---|
904 | |
---|
905 | <P> |
---|
906 | <PRE> |
---|
907 | From: jarausch@igpm.rwth-aachen.de (Helmut Jarausch) |
---|
908 | Subject: Re: Using gs (ghostscript) as a filter? |
---|
909 | To: lprng@iona.com |
---|
910 | Cc: Rick Gaine <rgaine@nbcs.rutgers.edu> |
---|
911 | Sender: majordomo-owner@iona.com |
---|
912 | Reply-To: lprng@iona.com |
---|
913 | >> |
---|
914 | >> Hello All: |
---|
915 | >> |
---|
916 | >> I would like to use LPRng 3.1.4 with an HP LaserJet 4P. I'd like to be |
---|
917 | >> able to use gs to convert PostScript files so that I can print them on my |
---|
918 | >> HP 4P. Can I do this with LPRng? If so, could someone semd me a printcap |
---|
919 | >> entry? I'd appreciate it. I am not sure how I will be cconnecting the |
---|
920 | >> printer yet, but I am thinking either serial or network. Probably serial |
---|
921 | >> though. Thanks for any help. |
---|
922 | </PRE> |
---|
923 | <P>This printcap works for my Deskjet: |
---|
924 | <PRE> |
---|
925 | djps |
---|
926 | :cm=Local Deskjet(GhostScript) |
---|
927 | :sd=/var/spool/djps:sf:sh:mx#0 |
---|
928 | :lp=/dev/plp |
---|
929 | :if=/usr/LOCAL/bin/LPRng/ps_to_deskjet: |
---|
930 | </PRE> |
---|
931 | <P>and this is the script /usr/LOCAL/bin/LPRng/ps_to_deskjet |
---|
932 | <PRE> |
---|
933 | #!/bin/sh |
---|
934 | nice -19 /usr/LOCAL/bin/gs -sDEVICE=cdj550 -sPAPERSIZE=a4 -sOutputFile=- -q -r300 - |
---|
935 | </PRE> |
---|
936 | |
---|
937 | <PRE> |
---|
938 | Helmut Jarausch |
---|
939 | Lehrstuhl f. Numerische Mathematik |
---|
940 | Institute of Technology |
---|
941 | RWTH Aachen |
---|
942 | D 52056 Aachen, Germany |
---|
943 | </PRE> |
---|
944 | <H2><A NAME="ss4.17">4.17 HP LaserJet IIISiMX</A> |
---|
945 | </H2> |
---|
946 | |
---|
947 | <P> |
---|
948 | <PRE> |
---|
949 | > From majordomo-owner@iona.com Mon Aug 31 11:17:26 1998 |
---|
950 | > To: lprng@iona.ie |
---|
951 | > Subject: [LPRng] problems printing PS-level2 jobs on LJIIIsi's... |
---|
952 | > Date: Mon, 31 Aug 1998 15:06:22 -0400 |
---|
953 | > From: "John Saroglou" <johny@yorku.ca> |
---|
954 | > |
---|
955 | > Greetings... |
---|
956 | > |
---|
957 | > I'm wondering if someone got around the problem of printing |
---|
958 | > Postscript(R) Level 2 jobs on Laser Jet IIIsi printers. |
---|
959 | > Our printers are direct network printers talking to a |
---|
960 | > print server running solaris 2.6 and lprng-3.5.1. |
---|
961 | > |
---|
962 | > Is there a fix (possible drivers?) for such problem? |
---|
963 | > |
---|
964 | > Thanks in advance. |
---|
965 | </PRE> |
---|
966 | <P>The LaserJet IIISi does not support PostScript level 2, only level 1 |
---|
967 | (really, it is called 3SiMX). |
---|
968 | The Windows (you are under Windows, right?) HP driver for 3Si/3Si MX |
---|
969 | PostScript should produce only PS level 1. |
---|
970 | <P>Beware: latest version of Adobe Windows PS driver produces *ONLY* PS |
---|
971 | level 2. |
---|
972 | <P>So, if you have (or receive) level 2 files, read them using ghostscript |
---|
973 | and print a screen dump :-) or as a bitmap. |
---|
974 | <P>You can too convert them into PDF (using either Adobe distiller or |
---|
975 | ghostscript ps2pdf) then use acroread to print the result. acroread can |
---|
976 | produce either level 1 or level 2 PostScript. THE definite solution ! |
---|
977 | <P>This trouble has nothing to do with the way they are connected or |
---|
978 | driven, it is only a driver problem. |
---|
979 | <P>I believe that HP had once a PS level2 update, but the price was so high |
---|
980 | that bying a new printer was a better solution! |
---|
981 | <PRE> |
---|
982 | Bertrand |
---|
983 | -- |
---|
984 | | Bertrand DECOUTY | mailto:Bertrand.Decouty@irisa.fr | |
---|
985 | | IRISA - INRIA (Atelier) | PHONE : 0299847346 / 0299847100 | |
---|
986 | | Campus de Beaulieu | FAX : +33 (0) 299842534 | |
---|
987 | | F-35042 Rennes Cedex - FRANCE | http://www.irisa.fr/ | |
---|
988 | </PRE> |
---|
989 | <H2><A NAME="ss4.18">4.18 HP Deskjet 1600CM</A> |
---|
990 | </H2> |
---|
991 | |
---|
992 | <P>The following printcap entry was posted by |
---|
993 | Olaf Lotzkat (Sysadm), Faculty of Computer Science, TU Dresden, Germany |
---|
994 | <CODE>>Olaf_Lotzkat@inf.tu-dresden.de<</CODE>. |
---|
995 | <PRE> |
---|
996 | # HP DeskJet 1600CM |
---|
997 | tinte|: |
---|
998 | :lp=dj1600cm%9100: |
---|
999 | :mx#0:rw:sf: |
---|
1000 | :ps=status:af=acct:lf=log:sd=/lpspool/tinte:fx=flpv: |
---|
1001 | :if=/usr/local/lib/filters/ifhp \ |
---|
1002 | -Tpagecount=off,forcepagecount=on,infostatus=off,sync=off: |
---|
1003 | :of=/usr/local/lib/filters/ofhp \ |
---|
1004 | -Tpagecount=off,forcepagecount=on,infostatus=off,sync=off,banner=off: |
---|
1005 | :vf=/usr/local/lib/filters/ifhp -c: |
---|
1006 | :bp=/usr/local/lib/filters/psbanner: |
---|
1007 | </PRE> |
---|
1008 | <H2><A NAME="ss4.19">4.19 HP JetDirect Interface</A> |
---|
1009 | </H2> |
---|
1010 | |
---|
1011 | <P>The HPJetDirect card can be configured through the front |
---|
1012 | panel or through a set of network files. Here is a summary |
---|
1013 | of the methods used from UNIX systems, or when you are |
---|
1014 | desperate, to configure the printer. |
---|
1015 | <H3>Setting Up IP Networking and Address</H3> |
---|
1016 | |
---|
1017 | <P>You can set the network address from the front panel. |
---|
1018 | Reset the printer, |
---|
1019 | put it in offline mode. |
---|
1020 | and then use the MENU, +-, SELECT keys as follows: |
---|
1021 | <PRE> |
---|
1022 | MENU -> MIO MENU (use MENU to display MIO MENU) |
---|
1023 | ITEM -> CFG NETWORK=NO* |
---|
1024 | + -> CFG NETWORK=YES |
---|
1025 | ENTER -> CFG NETWORK=YES* |
---|
1026 | ITEM -> TCP/IP=OFF* (use ITEM to display TCP/IP) |
---|
1027 | + -> TCP/IP=ON |
---|
1028 | ENTER -> TCP/IP=ON* |
---|
1029 | ITEM -> CFG TCP/IP=NO* (use ITEM to display TCP/IP) |
---|
1030 | + -> CFG TCP/IP=YES |
---|
1031 | ENTER -> CFG TCP/IP=YES* |
---|
1032 | ITEM -> BOOTP=NO* |
---|
1033 | (Enable BOOTP if you want to - see below) |
---|
1034 | ITEM -> IP BYTE 1=0* |
---|
1035 | This is IP address MSB byte. |
---|
1036 | Use +- keys to change value, and then ENTER to change |
---|
1037 | Use ITEM keys to get IP BYTE=2,3,4 |
---|
1038 | ITEM -> SM BYTE 1=255* |
---|
1039 | This is the subnet mask value |
---|
1040 | Use +- keys to change value, and then ENTER to change |
---|
1041 | Use ITEM keys to get IP BYTE=2,3,4 |
---|
1042 | ITEM -> LG BYTE 1=255* |
---|
1043 | This is the Syslog server (LoGger) IP address |
---|
1044 | Use +- keys to change value, and then ENTER to change |
---|
1045 | Use ITEM keys to get IP BYTE=2,3,4 |
---|
1046 | ITEM -> GW BYTE 1=255* |
---|
1047 | This is the subnet gateway (router) IP address |
---|
1048 | Use +- keys to change value, and then ENTER to change |
---|
1049 | Use ITEM keys to get IP BYTE=2,3,4 |
---|
1050 | ITEM -> TIMEOUT=90 |
---|
1051 | This is the connection timeout value. It puts a limit |
---|
1052 | on time between connections. A value of 10 is reasonable. |
---|
1053 | </PRE> |
---|
1054 | <P> |
---|
1055 | <H3>BOOTP Information</H3> |
---|
1056 | |
---|
1057 | <P>If you have a bootp server, you can put this information |
---|
1058 | in the bootptab file. To use this, you must enable the |
---|
1059 | bootp option on the printer. The T144 option specifies a |
---|
1060 | file to be read from the bootp server. This file is read by |
---|
1061 | using the TFTP protocol, and you must have a TFTPD server |
---|
1062 | enabled. Here is a sample bootptab entry. |
---|
1063 | <PRE> |
---|
1064 | # Example /etc/bootptab: database for bootp server (/etc/bootpd). |
---|
1065 | # Blank lines and lines beginning with '#' are ignored. |
---|
1066 | # |
---|
1067 | # Legend: |
---|
1068 | # |
---|
1069 | # first field -- hostname |
---|
1070 | # (may be full domain name) |
---|
1071 | # |
---|
1072 | # hd -- home directory |
---|
1073 | # bf -- bootfile |
---|
1074 | # cs -- cookie servers |
---|
1075 | # ds -- domain name servers |
---|
1076 | # gw -- gateways |
---|
1077 | # ha -- hardware address |
---|
1078 | # ht -- hardware type |
---|
1079 | # im -- impress servers |
---|
1080 | # ip -- host IP address |
---|
1081 | # lg -- log servers |
---|
1082 | # lp -- LPR servers |
---|
1083 | # ns -- IEN-116 name servers |
---|
1084 | # rl -- resource location protocol servers |
---|
1085 | # sm -- subnet mask |
---|
1086 | # tc -- template host (points to similar host entry) |
---|
1087 | # to -- time offset (seconds) |
---|
1088 | # ts -- time servers |
---|
1089 | # |
---|
1090 | # Be careful about including backslashes where they're needed. Weird (bad) |
---|
1091 | # things can happen when a backslash is omitted where one is intended. |
---|
1092 | # |
---|
1093 | peripheral1: |
---|
1094 | :hn:ht=ether:vm=rfc1048: |
---|
1095 | :ha=08000903212F: |
---|
1096 | :ip=190.40.101.22: |
---|
1097 | :sm=255.255.255.0: |
---|
1098 | :gw=190.40.101.1: |
---|
1099 | :lg=190.40.101.3: |
---|
1100 | :T144="hpnp/peripheral1.cfg": |
---|
1101 | </PRE> |
---|
1102 | <P>If you are using the T144 option, you will need to create |
---|
1103 | the configuration file. The sample configuration file from |
---|
1104 | the HP Direct distribution is included below. |
---|
1105 | <PRE> |
---|
1106 | # |
---|
1107 | # Example HP Network Peripheral Interface configuration file |
---|
1108 | # |
---|
1109 | # Comments begin with '#' and end at the end of the line. |
---|
1110 | # Blank lines are ignored. Entries cannot span lines. |
---|
1111 | |
---|
1112 | # Name is the peripheral (or node) name. It is displayed on the peripheral's |
---|
1113 | # self-test page or configuration plot, and when sysName is obtained through |
---|
1114 | # SNMP. This name can be provided in the BOOTP response or can be specified |
---|
1115 | # in the NPI configuration file to prevent the BOOTP response from overflowing |
---|
1116 | # the packet. The domain portion of the name is not necessary because the |
---|
1117 | # peripheral does not perform Domain Name System (DNS) searches. Name is |
---|
1118 | # limited to 64 characters. |
---|
1119 | |
---|
1120 | name: picasso |
---|
1121 | |
---|
1122 | # Location describes the physical location of the peripheral. This is the |
---|
1123 | # value used by the interface for the MIB-II sysLocation object. The default |
---|
1124 | # location is undefined. Only printable ASCII characters are allowed. |
---|
1125 | # Maximum length is 64 characters. |
---|
1126 | |
---|
1127 | location: 1st floor, south wall |
---|
1128 | |
---|
1129 | # Contact is the name of the person who administers or services the peripheral |
---|
1130 | # and may include how to contact this person. It is limited to 64 characters. |
---|
1131 | # This is the value used by the interface for the MIB-II sysContact object. |
---|
1132 | # The default contact is undefined. Only printable ASCII characters are |
---|
1133 | # allowed. Maximum length is 64 characters. |
---|
1134 | |
---|
1135 | contact: Phil, ext 1234 |
---|
1136 | |
---|
1137 | # The host access list contains the list of hosts or networks of hosts |
---|
1138 | # that are allowed to connect to the peripheral. The format is |
---|
1139 | # "allow: netnum [mask]", where netnum is a network number or a host IP |
---|
1140 | # address. Mask is an address mask of bits to apply to the network number |
---|
1141 | # and connecting host's IP address to verify access to the peripheral. |
---|
1142 | # The mask usually matches the network or subnet mask, but this is not |
---|
1143 | # required. If netnum is a host IP address, the mask 255.255.255.255 can |
---|
1144 | # be omitted. Up to ten access list entries are permitted. |
---|
1145 | |
---|
1146 | # to allow all of network 10 to access the peripheral: |
---|
1147 | allow: 10.0.0.0 255.0.0.0 |
---|
1148 | |
---|
1149 | # to allow a single host without specifying the mask: |
---|
1150 | allow: 15.1.2.3 |
---|
1151 | |
---|
1152 | # Idle timeout is the time (in seconds) after which an idle |
---|
1153 | # print data connection is closed. A value of zero disables |
---|
1154 | # the timeout mechanism. The default timeout is 90 seconds. |
---|
1155 | |
---|
1156 | idle-timeout: 120 |
---|
1157 | |
---|
1158 | # A community name is a password that allows SNMP access to MIB values on |
---|
1159 | # the network peripheral. Community names are not highly secure; they are |
---|
1160 | # not encrypted across the network. The get community name determines which |
---|
1161 | # SNMP GetRequests are responded to. By default, the network peripheral |
---|
1162 | # responds to all GetRequests. The get community name is limited to 32 |
---|
1163 | # characters. |
---|
1164 | # |
---|
1165 | # For hpnpstat and hpnpadmin, the community name can be stored in |
---|
1166 | # /usr/lib/hpnp/hpnpsnmp. |
---|
1167 | |
---|
1168 | get-community-name: blue |
---|
1169 | |
---|
1170 | # The set community name is similar to the get community name. The set |
---|
1171 | # community name determines which SNMP SetRequests are responded to. In |
---|
1172 | # addition, SetRequests are only honored if the sending host is on the |
---|
1173 | # host access list. By default, the network peripheral does not respond |
---|
1174 | # to any SetRequests. The set community name is limited to 32 characters. |
---|
1175 | # |
---|
1176 | # The set community name can come from /usr/lib/hpnp/hpnpsnmp |
---|
1177 | # if it is the same as the get community name. We recommend that the |
---|
1178 | # set community name be different from the get community name though. |
---|
1179 | |
---|
1180 | set-community-name: yellow |
---|
1181 | |
---|
1182 | # SNMP traps are asynchronous notifications of some event that has occurred. |
---|
1183 | # SNMP traps are useful only with network management software. Traps are |
---|
1184 | # sent to specific hosts and include a trap community name. Up to four |
---|
1185 | # hosts can be sent SNMP traps. The trap community name is limited to |
---|
1186 | # 32 characters. The default name is public. |
---|
1187 | |
---|
1188 | trap-community-name: red |
---|
1189 | |
---|
1190 | # The SNMP trap destination list specifies systems to which SNMP |
---|
1191 | # traps are sent. Up to four IP addresses are allowed. If no |
---|
1192 | # trap destinations are listed, traps are not sent. |
---|
1193 | |
---|
1194 | trap-dest: 15.1.2.3 |
---|
1195 | trap-dest: 15.2.3.4 |
---|
1196 | |
---|
1197 | # The SNMP authentication trap parameter enables or disables the sending |
---|
1198 | # of SNMP authentication traps. Authentication traps indicate that an SNMP |
---|
1199 | # request was received and the community name check failed. By default, |
---|
1200 | # the parameter is off. |
---|
1201 | |
---|
1202 | authentication-trap: on |
---|
1203 | |
---|
1204 | # The syslog-facility parameter sets the source facility identifier that the |
---|
1205 | # card uses when issuing syslog messages. Other facilities, for example, |
---|
1206 | # include the kernel (LOG_KERN), the mail system (LOG_MAIL), and the spooling |
---|
1207 | # system (LOG_LPR). The card only allows its syslog facility to be configured |
---|
1208 | # to one of the local user values (LOG_LOCAL0 through LOG_LOCAL7). The |
---|
1209 | # selectable option strings, local0 through local7 (configured to LOG_LOCAL0 |
---|
1210 | # through LOG_LOCAL7, respectively) are case insensitive. The default |
---|
1211 | # syslog-facility for the card is LOG_LPR. |
---|
1212 | |
---|
1213 | syslog-facility: local2 |
---|
1214 | |
---|
1215 | # This parameter allows the card to treat hosts on other subnets as if the |
---|
1216 | # hosts were on the card's subnet. This parameter determines the TCP |
---|
1217 | # Maximum Segment Size (MSS) advertised by the card to hosts on other subnets |
---|
1218 | # and affects the card's initial receive-window size. The card will use a |
---|
1219 | # TCP MSS of 1460 bytes for local hosts, and 536 bytes for a non-local host. |
---|
1220 | # The default is off, that is, the card will use the maximum packet sizes |
---|
1221 | # only on the card's configured subnet. |
---|
1222 | # |
---|
1223 | # The configuration utility does not allow access to this parameter. If you |
---|
1224 | # want to configure it, you must manually edit the NPI configuration file |
---|
1225 | # and add it to the bottom of the entry for the network peripheral. |
---|
1226 | |
---|
1227 | subnets-local: on |
---|
1228 | |
---|
1229 | # This parameter affects how the card handles TCP connection requests from |
---|
1230 | # the host. By default, the JetDirect MPS card will accept a TCP connection |
---|
1231 | # even if the peripheral is off-line. If this parameter is set to "on", then |
---|
1232 | # the card will only accept a TCP connection when the peripheral is on-line. |
---|
1233 | |
---|
1234 | old-idle-mode: off |
---|
1235 | </PRE> |
---|
1236 | <P> |
---|
1237 | <H3>Paper Tray Selection</H3> |
---|
1238 | |
---|
1239 | <P>Be careful with your paper tray selection. You should configure the |
---|
1240 | printer, using the front panel switches, to select the FIRST paper |
---|
1241 | tray. See your printer documentation on this. Unfortunately, different |
---|
1242 | models of HP printers have different methods of handling paper trays. |
---|
1243 | <H2><A NAME="ss4.20">4.20 Lexmark Printers</A> |
---|
1244 | </H2> |
---|
1245 | |
---|
1246 | <P>Some Lexmark printers do not send |
---|
1247 | <EM>end of job</EM> status back unless configured |
---|
1248 | to do so. |
---|
1249 | Here is what is needed to force this. |
---|
1250 | <PRE> |
---|
1251 | Date: Wed, 21 Jan 1998 18:25:50 -0600 (CST) |
---|
1252 | From: Matt White <whitem@bofh.usask.ca> |
---|
1253 | To: lprng@iona.com |
---|
1254 | Subject: Re: [LPRng] CTI-ifhp with Lexmark Optra N printer |
---|
1255 | |
---|
1256 | On Wed, 21 Jan 1998, Simon Greaves wrote: |
---|
1257 | |
---|
1258 | > Apologies in advance if this is way off mark, but we've been evaluating a |
---|
1259 | > commercial print charging package (Geomica) which works by talking to the |
---|
1260 | > printer in what I think is a similar way to the ifhp filters. Lexmarks are |
---|
1261 | > currently a big headache because they seem to fail to return the message |
---|
1262 | > that they have finished printing which screws things up somewhat. In our |
---|
1263 | > case, it is believed to be a problem with the Lexmark firmware which they |
---|
1264 | > are looking into. |
---|
1265 | |
---|
1266 | There is a fix for that...it is originally from the Lexmark 4039 series, |
---|
1267 | but it still works on the Optra S 1650 machines that we have (and should |
---|
1268 | work on the rest of the optra line). Just send this little chunk of |
---|
1269 | postscript to the printer once: |
---|
1270 | |
---|
1271 | -----------snip---------- |
---|
1272 | %! Postscript utility file to set the 4039 printer into synchronous mode |
---|
1273 | serverdict begin 0 exitserver |
---|
1274 | statusdict begin true setenginesync end |
---|
1275 | -----------snip---------- |
---|
1276 | |
---|
1277 | Basically, it causes the printer to wait until it is finished printing |
---|
1278 | before actually reporting that it is done. I've got 3 Optra S printers |
---|
1279 | running with ifhp right now with no extra options (just defaults). |
---|
1280 | |
---|
1281 | --------------------------------------------------------------------- |
---|
1282 | - Matt White whitem@arts.usask.ca - |
---|
1283 | - Network Technical Support http://arts.usask.ca/~whitem - |
---|
1284 | - College of Arts & Science University of Saskatchewan - |
---|
1285 | --------------------------------------------------------------------- |
---|
1286 | </PRE> |
---|
1287 | <P> |
---|
1288 | <H2><A NAME="ss4.21">4.21 Tektronix P450 and Family</A> |
---|
1289 | </H2> |
---|
1290 | |
---|
1291 | <P>The Tektronix P450 has a very odd network interface. |
---|
1292 | You can open a TCP (stream) connection to port 9100 and send a file to be |
---|
1293 | printed on the connection. |
---|
1294 | <P>When a UDP datagram is sent to UDP Port 9101, |
---|
1295 | the printer resonds with status information. |
---|
1296 | This apparently is the poor man's SNMP, |
---|
1297 | but I digress. |
---|
1298 | Here is a clever implementation of a filter that handles this printer. |
---|
1299 | <PRE> |
---|
1300 | From: Russ Thacher <thacher@brl.uiuc.edu> |
---|
1301 | To: lprng@iona.com |
---|
1302 | Subject: Re: [LPRng] Tektronix P450 & psfilter |
---|
1303 | |
---|
1304 | Having only limited success with the psfilter UDP status port option, and |
---|
1305 | not satisfied with the overall slowness of sending print jobs out via |
---|
1306 | AppleShare with CAP, I (we) decided to roll our own filter for the Phaser |
---|
1307 | 450 that speaks AppSocket (sending on TCP 9100, monitoring UDP 9101), |
---|
1308 | grabs reliable page counts and can tell the Phaser to switch to |
---|
1309 | transparency mode based upon LPRng queue alias ('qq' printcap option). |
---|
1310 | |
---|
1311 | Here's out printcap entry for the Phaser 450, using our filter: |
---|
1312 | |
---|
1313 | # Tektronix Phaser 450-2 |
---|
1314 | phaser450-2|phaser450-2t|phaser440|phaser440t |
---|
1315 | :lp=/dev/null:qq |
---|
1316 | :af=acct:lf=log:fx=flpv:sh:mx#0:ps=status |
---|
1317 | :if=/usr/local/lib/filters/phaserif |
---|
1318 | :sd=/var/spool/lpd/phaser450-2 |
---|
1319 | |
---|
1320 | Attached is the Perl filter I wrote that has been very slightly modified |
---|
1321 | since its inception by Al Marquardt. It's written with Solaris in mind |
---|
1322 | and is perhaps a little crude, but it works quite well for us. Feel free |
---|
1323 | to modify/use it in any way you like- direct any and all comments to Al |
---|
1324 | Marquardt (almar@uiuc.edu). |
---|
1325 | |
---|
1326 | -- |
---|
1327 | Russ Thacher |
---|
1328 | Systems Administrator, UIUC Bioacoustics Research Lab |
---|
1329 | |
---|
1330 | -------------- Filter ----------------- |
---|
1331 | #!/usr/local/bin/perl5 |
---|
1332 | |
---|
1333 | use Getopt::Std; |
---|
1334 | use Socket; |
---|
1335 | use Sys::Hostname; |
---|
1336 | |
---|
1337 | pop @ARGV; |
---|
1338 | |
---|
1339 | # Get all the filter options LPRng knows |
---|
1340 | |
---|
1341 | getopts('a:b:cd:e:f:h:i:j:k:l:m:n:p:r:s:t:w:x:y:F:P:S:C:H:A:J:L:Q:'); |
---|
1342 | |
---|
1343 | # set default exit status (JFAIL) |
---|
1344 | |
---|
1345 | $! = 1; |
---|
1346 | |
---|
1347 | # Set default error messages |
---|
1348 | |
---|
1349 | $udpsockerr = "ERROR: Cannot establish UDP socket: $!\n"; |
---|
1350 | $udpbinderr = "ERROR: Cannot bind to UDP socket: $!\n"; |
---|
1351 | $udpsenderr = "ERROR: Cannot send UDP status request: !$\n"; |
---|
1352 | $udprecverr = "ERROR: Cannot receive UDP status report: !$\n"; |
---|
1353 | $tcpsockerr = "ERROR: Cannot establish TCP socket: $!\n"; |
---|
1354 | $tcpconnecterr = "ERROR: Cannot connect to TCP socket: $!\n"; |
---|
1355 | $tcpcloseerr = "ERROR: Cannot close TCP socket: $!\n"; |
---|
1356 | |
---|
1357 | # Get current time/date |
---|
1358 | |
---|
1359 | @MONTHS = ( "Jan", "Feb", "Mar", "Apr", "May", "Jun", |
---|
1360 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ); |
---|
1361 | ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); |
---|
1362 | $month = $MONTHS[$mon]; |
---|
1363 | if (length($sec) == 1) { $sec = "0$sec" } |
---|
1364 | if (length($min) == 1) { $min = "0$min" } |
---|
1365 | if (length($hour) == 1) { $hour= "0$hour" } |
---|
1366 | if (length($mday) == 1) { $mday= " $mday" } |
---|
1367 | |
---|
1368 | $datestamp = "$month $mday $hour:$min:$sec"; |
---|
1369 | |
---|
1370 | # Write a 'job begin' line to printer log file |
---|
1371 | |
---|
1372 | print STDERR "START: job number $opt_j (dfile: $opt_e) for $opt_n\@$opt_h on $opt_P at $datestamp\n"; |
---|
1373 | |
---|
1374 | # Setup network info for printers |
---|
1375 | |
---|
1376 | $phaser4501 = 'phaser450-1'; |
---|
1377 | $phaser4502 = 'phaser440'; |
---|
1378 | |
---|
1379 | $udpport = '9101'; |
---|
1380 | $tcpport = '9100'; |
---|
1381 | |
---|
1382 | # Setting up UDP socket info so we can get status reports from phasers... |
---|
1383 | |
---|
1384 | $myip = gethostbyname(hostname()); |
---|
1385 | |
---|
1386 | $udpproto = getprotobyname('udp'); |
---|
1387 | $myudppaddr = sockaddr_in(0, $myip); |
---|
1388 | |
---|
1389 | if ($opt_P eq 'phaser450-1') { |
---|
1390 | $printip = inet_aton($phaser4501); |
---|
1391 | } |
---|
1392 | elsif ($opt_P eq 'phaser450-2') { |
---|
1393 | $printip = inet_aton($phaser4502); |
---|
1394 | } |
---|
1395 | |
---|
1396 | $printudppaddr = sockaddr_in($udpport, $printip); |
---|
1397 | |
---|
1398 | socket(UDPSOCK, PF_INET, SOCK_DGRAM, $udpproto) or die $udpsockerr; |
---|
1399 | bind(UDPSOCK, $myudppaddr) or die $udpbinderr; |
---|
1400 | |
---|
1401 | # Setting up TCP socket info so we can send jobs to the printer |
---|
1402 | # and read pagecounts |
---|
1403 | |
---|
1404 | $tcpproto = getprotobyname('tcp'); |
---|
1405 | $mytcppaddr = sockaddr_in(0, $myip); |
---|
1406 | $printtcppaddr = sockaddr_in($tcpport, $printip); |
---|
1407 | socket(TCPSOCK, PF_INET, SOCK_STREAM, $tcpproto) or die $tcpsockerr; |
---|
1408 | setsockopt(TCPSOCK, SOL_SOCKET, SO_KEEPALIVE, 0); |
---|
1409 | setsockopt(TCPSOCK, SOL_SOCKET, SO_LINGER, 0); |
---|
1410 | |
---|
1411 | # Before any printing check to be sure printer is idle |
---|
1412 | # If it's not, check every 5 seconds until it is |
---|
1413 | |
---|
1414 | defined(send(UDPSOCK, "\r\n", 0, $printudppaddr)) or die $udpsenderr; |
---|
1415 | $udpout = ""; |
---|
1416 | ($printudppaddr = recv(UDPSOCK, $udpout, 100, 0)) or die $udprecverr; |
---|
1417 | $realudpout = unpack("a*", $udpout); |
---|
1418 | |
---|
1419 | while ($realudpout ne 'status: idle') { |
---|
1420 | print STDERR "$opt_P not at idle status. Cannot start print job.\n"; |
---|
1421 | defined(send(UDPSOCK, "\r\n", 0, $printudppaddr)) or die $udpsenderr; |
---|
1422 | $udpout = ""; |
---|
1423 | ($printudppaddr = recv(UDPSOCK, $udpout, 100, 0)) or die $udprecverr; |
---|
1424 | $realudpout = unpack("a*", $udpout); |
---|
1425 | sleep 5; |
---|
1426 | } |
---|
1427 | |
---|
1428 | # Get the initial page count |
---|
1429 | |
---|
1430 | connect(TCPSOCK, $printtcppaddr) or die $tcpconnecterr; |
---|
1431 | select TCPSOCK; |
---|
1432 | $| = 1; |
---|
1433 | select STDOUT; |
---|
1434 | print TCPSOCK "%!\n"; |
---|
1435 | print TCPSOCK "(%%\[ pagecount: )print statusdict /pagecount get exec "; |
---|
1436 | print TCPSOCK "( )cvs print "; |
---|
1437 | print TCPSOCK "( \]%%) = flush\n"; |
---|
1438 | $tcpout = <TCPSOCK>; |
---|
1439 | if ($tcpout =~ /%%\[ pagecount:.*/) { |
---|
1440 | @tcparray = split /\s/, $tcpout; |
---|
1441 | $pagecount1 = $tcparray[2]; |
---|
1442 | } |
---|
1443 | |
---|
1444 | # Get current time/date (again, this time for the accounting file) |
---|
1445 | |
---|
1446 | ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); |
---|
1447 | $month = $MONTHS[$mon]; |
---|
1448 | if (length($sec) == 1) { $sec = "0$sec" } |
---|
1449 | if (length($min) == 1) { $min = "0$min" } |
---|
1450 | if (length($hour) == 1) { $hour= "0$hour" } |
---|
1451 | if (length($mday) == 1) { $mday= " $mday" } |
---|
1452 | |
---|
1453 | $datestamp = "$month $mday $hour:$min:$sec"; |
---|
1454 | |
---|
1455 | # open LPRng accounting file |
---|
1456 | |
---|
1457 | if( defined( $opt_a ) && $opt_a && open ACCT, ">>$opt_a" ){ |
---|
1458 | print ACCT "DEBUG: printer return string= $tcpout"; |
---|
1459 | print ACCT "start -p'$pagecount1' -q'$opt_j' -J'$opt_J' -k'$opt_k' -n'$opt_n' -h'$opt_h' -P'$opt_P' -F'$opt_F' -t'$datestamp'\n"; |
---|
1460 | close ACCT; |
---|
1461 | } |
---|
1462 | |
---|
1463 | # Start shoving data out to printer |
---|
1464 | |
---|
1465 | # Set print/transparency by queue name |
---|
1466 | |
---|
1467 | if ($opt_Q =~ /.*t/) { |
---|
1468 | print TCPSOCK "%!\n"; |
---|
1469 | print TCPSOCK "mark\n"; |
---|
1470 | print TCPSOCK "{\n"; |
---|
1471 | print TCPSOCK " 3 dict begin\n"; |
---|
1472 | print TCPSOCK " /MediaType null def\n"; |
---|
1473 | print TCPSOCK " /MediaColor (Transparent) def\n"; |
---|
1474 | print TCPSOCK " currentdict end setpagedevice\n"; |
---|
1475 | print TCPSOCK "} stopped cleartomark\n"; |
---|
1476 | } |
---|
1477 | |
---|
1478 | # Shove the rest of the data file out to the printer |
---|
1479 | |
---|
1480 | while ($line = <STDIN>) { |
---|
1481 | print TCPSOCK $line; |
---|
1482 | } |
---|
1483 | |
---|
1484 | close TCPSOCK or die $tcpcloseerr; |
---|
1485 | |
---|
1486 | # Listen for 'status:idle' from printer- this signifies that job is done and |
---|
1487 | # we can ask printer for page count |
---|
1488 | # we wait until 'status:idle' is received- retrying every 3 seconds |
---|
1489 | |
---|
1490 | $realudpout = ""; |
---|
1491 | |
---|
1492 | while ($realudpout ne 'status: idle') { |
---|
1493 | defined(send(UDPSOCK, "\r\n", 0, $printudppaddr)) or die $udpsenderr; |
---|
1494 | $udpout = ""; |
---|
1495 | ($printudppaddr = recv(UDPSOCK, $udpout, 100, 0)) or die $udprecverr; |
---|
1496 | $realudpout = unpack("a*", $udpout); |
---|
1497 | sleep 2; |
---|
1498 | } |
---|
1499 | |
---|
1500 | # Now we're ready to grab the final page count from the printer |
---|
1501 | |
---|
1502 | socket(TCPSOCK, PF_INET, SOCK_STREAM, $tcpproto) or die $tcpsockerr; |
---|
1503 | connect(TCPSOCK, $printtcppaddr) or die $tcpconnecterr; |
---|
1504 | |
---|
1505 | print TCPSOCK "%!\n"; |
---|
1506 | print TCPSOCK "(%%\[ pagecount: )print statusdict /pagecount get exec "; |
---|
1507 | print TCPSOCK "( )cvs print "; |
---|
1508 | print TCPSOCK "( \]%%) = flush\n"; |
---|
1509 | $tcpout = <TCPSOCK>; |
---|
1510 | if ($tcpout =~ /%%\[ pagecount:.*/) { |
---|
1511 | @tcparray = split /\s/, $tcpout; |
---|
1512 | $pagecount2 = $tcparray[2]; |
---|
1513 | } |
---|
1514 | |
---|
1515 | close TCPSOCK or die $tcpcloseerr; |
---|
1516 | |
---|
1517 | # Get date/time again |
---|
1518 | |
---|
1519 | ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); |
---|
1520 | $month = $MONTHS[$mon]; |
---|
1521 | if (length($sec) == 1) { $sec = "0$sec" } |
---|
1522 | if (length($min) == 1) { $min = "0$min" } |
---|
1523 | if (length($hour) == 1) { $hour= "0$hour" } |
---|
1524 | if (length($mday) == 1) { $mday= " $mday" } |
---|
1525 | |
---|
1526 | $datestamp = "$month $mday $hour:$min:$sec"; |
---|
1527 | |
---|
1528 | # Update accounting file upon close |
---|
1529 | |
---|
1530 | $pages = $pagecount2 - $pagecount1; |
---|
1531 | |
---|
1532 | if( defined( $opt_a ) && $opt_a && open ACCT, ">>$opt_a" ){ |
---|
1533 | print ACCT "DEBUG: printer return string= $tcpout"; |
---|
1534 | print ACCT "end -b'$pages' -p'$pagecount2' -q'$opt_j' -J'$opt_J' -k'$opt_k' -n'$opt_n' -h'$opt_h' -P'$opt_P' -F'o' -t'$datestamp'\n"; |
---|
1535 | close ACCT; |
---|
1536 | } |
---|
1537 | |
---|
1538 | # Write a 'Job End' line to the printer log |
---|
1539 | |
---|
1540 | print STDERR "END: job number $opt_j (dfile: $opt_e) for $opt_n\@$opt_h on $opt_P at $datestamp\n\n"; |
---|
1541 | </PRE> |
---|
1542 | <P> |
---|
1543 | <H2><A NAME="ss4.22">4.22 Duplex Printing</A> |
---|
1544 | </H2> |
---|
1545 | |
---|
1546 | <P>Duplex printing is when you print on both sides of a page. |
---|
1547 | Some printers which do duplex printing require that you |
---|
1548 | send them special commands to force this mode. This is |
---|
1549 | usually done by the FILTERS. The CTI-ifhp (for HP PJL printers) |
---|
1550 | and psfilter (for PostScript Printers) make a stab at sending |
---|
1551 | the PJL or PostScript commands to the printer. Many people have |
---|
1552 | reported problems doing duplex printing, so here is a check |
---|
1553 | list. |
---|
1554 | <OL> |
---|
1555 | <LI>Make sure you have enough memory for the worst case |
---|
1556 | print job. Usually the printer has to rasterize both |
---|
1557 | pages before it can produce an impression. It may require |
---|
1558 | much more memory than you expect.</LI> |
---|
1559 | <LI>Check your printer manual to discover the EXACT form of the |
---|
1560 | <CODE>enter duplex mode</CODE> command and make sure that either the command |
---|
1561 | is part of the job (PJL language at the start of the job, |
---|
1562 | postscript header, etc), or that the filter generates the |
---|
1563 | correct form. |
---|
1564 | <P>Note there is a PostScript Printer Description file (PPD) for |
---|
1565 | most printers that support PostScript, and they even have the |
---|
1566 | PJL and PostScript code for this in the PPD file. |
---|
1567 | </LI> |
---|
1568 | <LI>It has been observed that even with what would apparently be |
---|
1569 | sufficient memory, that many duplex jobs print 'oddly', |
---|
1570 | that they are not aligned on the same side in the same way, |
---|
1571 | etc etc. This may not be the fault of the software, but of the |
---|
1572 | support for duplex operation.</LI> |
---|
1573 | <LI>Get the source code for psfilter or CTI-ifhp filter, and modify the |
---|
1574 | appropriate lines to send the appropriate "turn on duplex" strings |
---|
1575 | to the printer.</LI> |
---|
1576 | </OL> |
---|
1577 | <P>I know this is painful, but until there is a uniform way to get the |
---|
1578 | correct commands extracted from either PPD or some other database then |
---|
1579 | this appears to be the only way to do it. |
---|
1580 | <BLOCKQUOTE> |
---|
1581 | <EM>Patrick Powell</EM> |
---|
1582 | </BLOCKQUOTE> |
---|
1583 | <H2><A NAME="ss4.23">4.23 TESTVERSION and Portability Testing</A> |
---|
1584 | </H2> |
---|
1585 | |
---|
1586 | <P>The LPRng code has the ability to run as non-setuid software, |
---|
1587 | and to use the non-default TCP/IP ports for communication. |
---|
1588 | This facility allows a <EM>TESTVERSION</EM> to be run in parallel with the |
---|
1589 | normal LPRng software. |
---|
1590 | <P>To simplify testing and portability issues, |
---|
1591 | a simple test version of the spool queues and jobs has been supplied with the |
---|
1592 | LPRng distribution. |
---|
1593 | These queues can be placed in a suitable location |
---|
1594 | (<CODE>/tmp</CODE> is common) and the LPRng software tested. |
---|
1595 | <P>The test version of the software will use the <CODE>LPD_CONF</CODE> |
---|
1596 | environment variable to specify the location of the configuration file. |
---|
1597 | It will read this configuration file on startup and use the values |
---|
1598 | to override the normal defaults. |
---|
1599 | Since a user could maliciously set up their own configuration files |
---|
1600 | with values that could compromise system security, |
---|
1601 | it is strongly recommended that the test version is not made SETUID root. |
---|
1602 | In fact, |
---|
1603 | the LPRng code will chatter messages when the LPD_CONF ability is enabled |
---|
1604 | and it is run as root. |
---|
1605 | <H3>Compiling the TESTVERSION</H3> |
---|
1606 | |
---|
1607 | <P>The TESTVERSION of the software can be compiled in two ways: |
---|
1608 | <OL> |
---|
1609 | <LI>Remove the <CODE>vars.o</CODE> file, |
---|
1610 | and then explicitly request the generation of the test version: |
---|
1611 | <PRE> |
---|
1612 | cd src |
---|
1613 | rm ./vars.o |
---|
1614 | make TESTVERSION=yes |
---|
1615 | </PRE> |
---|
1616 | </LI> |
---|
1617 | <LI>Edit <CODE>src/Makefile</CODE>, and uncomment the indicated line. |
---|
1618 | Then run <CODE>make</CODE> to regenerate the distribution. |
---|
1619 | This is the preferred method of generating the software. |
---|
1620 | <PRE> |
---|
1621 | #### ****** TESTING AND SECURITY LOOPHOLE ****************************** |
---|
1622 | # Define TESTVERSION and GETENV to allow the LPD_CONFIG environment |
---|
1623 | # variable to be used as the name of a configuration file. In non-testing |
---|
1624 | # systems, this is a security loophole. |
---|
1625 | # TESTVERSION=yes |
---|
1626 | </PRE> |
---|
1627 | </LI> |
---|
1628 | </OL> |
---|
1629 | <H3>Setting up the TESTVERSION Spool Queues</H3> |
---|
1630 | |
---|
1631 | <P>The LPRng <CODE>TESTSUPPORT</CODE> directory contains a set of shell scripts |
---|
1632 | and files that need to be installed in the appropriate directory. |
---|
1633 | The following steps are used. |
---|
1634 | <OL> |
---|
1635 | <LI>First, |
---|
1636 | you need to set up your <CODE>HOST</CODE> environment variable to the fully |
---|
1637 | qualified domain name of your host |
---|
1638 | and your <CODE>USER</CODE> environment variable to your user name. |
---|
1639 | This is done in order to get values to put into the TESTVERSION configuration files.</LI> |
---|
1640 | <LI>In the <CODE>TESTSUPPORT</CODE> directory, |
---|
1641 | edit the <CODE>Makefile</CODE>, |
---|
1642 | and specify the location of the <CODE>TESTVERSION</CODE> spool queues. |
---|
1643 | The default location is <CODE>/tmp</CODE>; |
---|
1644 | since on most systems these files are deleted or are available to everybody, |
---|
1645 | a more secure location should most likely be used. |
---|
1646 | <B>DO NOT USE THE RAW TESTFILE DIRECTORY</B>. |
---|
1647 | These files need to be copied and placed in another directory.</LI> |
---|
1648 | <LI>The <CODE>LPD_CONF</CODE> environment variable should be set to the |
---|
1649 | location of the installed lpd.conf file.</LI> |
---|
1650 | <LI>In the <CODE>TESTSUPPORT</CODE> directory, |
---|
1651 | run <CODE>make</CODE>. |
---|
1652 | This will copy and install the necessary files.</LI> |
---|
1653 | </OL> |
---|
1654 | <P>Example: |
---|
1655 | <PRE> |
---|
1656 | CSH: |
---|
1657 | setenv HOST {fully qualified domain name}; |
---|
1658 | setenv USER `whoami` |
---|
1659 | setenv LPD_CONF /tmp/LPD/lpd.conf |
---|
1660 | set path=( /tmp/LPD $path ) |
---|
1661 | unsetenv PRINTER |
---|
1662 | Example: |
---|
1663 | setenv HOST astart1.astart.com |
---|
1664 | setenv USER papowell |
---|
1665 | setenv LPD_CONF /tmp/LPD/lpd.conf |
---|
1666 | set path=( /tmp/LPD $path ) |
---|
1667 | unsetenv PRINTER |
---|
1668 | Bourne Shell: |
---|
1669 | HOST={fully qualified domain name}; export HOST; |
---|
1670 | USER='whoami'; export USER |
---|
1671 | LPD_CONF=/tmp/LPD/lpd.conf.$HOST; export LPD_CONF |
---|
1672 | PATH=/tmp/LPD:$PATH; export PATH |
---|
1673 | PRINTER=; export PRINTER |
---|
1674 | Example: |
---|
1675 | HOST=astart1.astart.com; export HOST |
---|
1676 | USER=papowell; export USER |
---|
1677 | LPD_CONF=/tmp/LPD/lpd.conf.$HOST; export LPD_CONF |
---|
1678 | PATH=/tmp/LPD:$PATH; export PATH |
---|
1679 | PRINTER=; export PRINTER |
---|
1680 | cd TESTSUPPORT |
---|
1681 | make |
---|
1682 | </PRE> |
---|
1683 | <H3>Portability Testing</H3> |
---|
1684 | |
---|
1685 | <P>You should ignore the information in this section UNLESS you are |
---|
1686 | trying to do a port to a new or whacko version of a UNIX system. |
---|
1687 | LPRng has been tested on just about every version of UNIX that supports |
---|
1688 | POSIX capabilities, |
---|
1689 | and if it is having problems then most likely it is due to non-portability |
---|
1690 | issues. |
---|
1691 | However, |
---|
1692 | if you feel that your system is not POSIX compatible, |
---|
1693 | or you are having serious problems due to LPRng's use of the system facilities, |
---|
1694 | feel free to try the following tests. |
---|
1695 | <P>Needless to say, |
---|
1696 | if you identify problems, please inform the developers and they will |
---|
1697 | most likely assist you in resolving them. |
---|
1698 | <P>Set your current directory to the location of the compiled <CODE>TESTVERSION</CODE> |
---|
1699 | executables. |
---|
1700 | Execute the various executables using <CODE>./cmd</CODE>, |
---|
1701 | or set <CODE>.</CODE> <B> as the first entry in the PATH </B>. |
---|
1702 | If it is not the first entry, |
---|
1703 | then the standard system executables will be used. |
---|
1704 | <OL> |
---|
1705 | <LI> Run <CODE>./checkpc -T /tmp/a</CODE>. |
---|
1706 | This will perform a limited set of tests of the LPRng functionality. |
---|
1707 | Note that some of them will fail as checkpc is not running SUID ROOT |
---|
1708 | and the <CODE>/tmp/a</CODE> is not a serial device. |
---|
1709 | ALL of the non-SUID related messages should indicate success.</LI> |
---|
1710 | <LI> Set <CODE>checkpc</CODE> to setuid ROOT, and then rerun the tests. |
---|
1711 | <PRE> |
---|
1712 | chown root checkpc |
---|
1713 | chmod u+s checkpc |
---|
1714 | ./checkpc -T /tmp/a |
---|
1715 | </PRE> |
---|
1716 | |
---|
1717 | <P>The SETUID tests should now succeed. |
---|
1718 | If they do not, |
---|
1719 | then you have a VERY odd UNIX system, |
---|
1720 | and you are on your own on this one. |
---|
1721 | See the comments in <CODE>src/common/setuid.c</CODE> for help. |
---|
1722 | </LI> |
---|
1723 | <LI>Now run tests for serial line control and locking: |
---|
1724 | <PRE> |
---|
1725 | ./checkpc -T /dev/ttya # or an appropriate UNUSED tty device |
---|
1726 | </PRE> |
---|
1727 | |
---|
1728 | <P>You most likely will have to attach a terminal or modem to the serial device |
---|
1729 | in order to cause the <CODE>open()</CODE> to succeed, |
---|
1730 | as most serial device drivers block when <CODE>DSR</CODE> is not enabled. |
---|
1731 | Check the messages concerning the <CODE>stty</CODE> actions. |
---|
1732 | Make sure that the appropriate changes have taken place. |
---|
1733 | <P>You may get errors about <EM>device lock</EM> failing. |
---|
1734 | This is due to whacko differences in the ways that different UNIX systems |
---|
1735 | (or versions of the same UNIX system) implement serial device locking. |
---|
1736 | My advice is to ignore this problem unless you INSIST on having multiple users |
---|
1737 | of the same serial printing port, |
---|
1738 | in which case you are asking for serious trouble, |
---|
1739 | and you are on your own. |
---|
1740 | I am not interested in patches or queries on problems on serial device locking |
---|
1741 | problems. |
---|
1742 | In fact, |
---|
1743 | this facility is only used if the <CODE>lk</CODE> printcap flag is TRUE |
---|
1744 | (default FALSE). |
---|
1745 | </LI> |
---|
1746 | </OL> |
---|
1747 | <H3>Running the TESTVERSION Software</H3> |
---|
1748 | |
---|
1749 | <P>Set your current directory to the location of the compiled <CODE>TESTVERSION</CODE> |
---|
1750 | executables. |
---|
1751 | Execute the various executables using <CODE>./cmd</CODE>, |
---|
1752 | or set <CODE>.</CODE> <B> as the first entry in the PATH </B>. |
---|
1753 | If it is not the first entry, |
---|
1754 | then the standard system executables will be used. |
---|
1755 | <OL> |
---|
1756 | <LI> Run <CODE>./checkpc</CODE>. |
---|
1757 | this will print out the various values for the spool queues in the <CODE>TESTVERSION</CODE> |
---|
1758 | setup. |
---|
1759 | If the <CODE>t1</CODE>, <CODE>t2</CODE>,... spool queues are not displayed, |
---|
1760 | make sure that the LPD_CONF environment variable is set correctly and that you |
---|
1761 | are using the <CODE>TESTVERSION</CODE> executable.</LI> |
---|
1762 | <LI>Run <CODE>./checkpc -f</CODE>. |
---|
1763 | This will fix up the (deliberately introduced) problems in the spool queues.</LI> |
---|
1764 | <LI>Next, run <CODE>./lpd -F</CODE> in one window, |
---|
1765 | and then run <CODE>./lpq -a </CODE> in another window. |
---|
1766 | This will check that the server is working.</LI> |
---|
1767 | <LI>You can now amuse yourself by sending jobs, |
---|
1768 | setting up permissions checking, |
---|
1769 | and other chores.</LI> |
---|
1770 | <LI>When everything appears to be working correctly, |
---|
1771 | you can then remove the <CODE>TESTVERSION</CODE> flag from the |
---|
1772 | <CODE>src/Makefile</CODE>, recompile, |
---|
1773 | and install the LPRng software.</LI> |
---|
1774 | </OL> |
---|
1775 | |
---|
1776 | <A NAME="printcapref"></A> <HR> |
---|
1777 | <A HREF="LPRng-HOWTO-5.html">Next</A> |
---|
1778 | <A HREF="LPRng-HOWTO-3.html">Previous</A> |
---|
1779 | <A HREF="LPRng-HOWTO.html#toc4">Contents</A> |
---|
1780 | </BODY> |
---|
1781 | </HTML> |
---|