source: trunk/third/lprng/doc/LPRng-HOWTO-4.html @ 12500

Revision 12500, 65.8 KB checked in by ghudson, 26 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r12499, which included commits to RCS files with non-trunk default branches.
Line 
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
14and the database files.
15This section deals with generating and installing the executable
16files.
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.
21However,
22for most users it will require the executables
23for the server <CODE>lpd</CODE>, and the client applications for
24job submission - <CODE>lpr</CODE>,
25job status - <CODE>lpq</CODE>,
26job removal - <CODE>lprm</CODE>,
27and server management - <CODE>lprc</CODE>,
28and the <CODE>/etc/lpd.conf</CODE>
29and <CODE>/etc/printcap</CODE> files.
30<P>By default,
31all the LPRng executables are installed in
32<CODE>/usr/local/bin</CODE>,
33which differs from other UNIX lpr systems,
34which scatter them in various hidden and arcane locations.  Note that the
35original printing system executables will need to be renamed or removed after
36installing LPRng.
37<P>The
38<CODE>
39<A HREF="LPRng-HOWTO-7.html#lpdconf">/etc/lpd.conf</A></CODE>
40file contains the configuration
41information for the server and application programs.
42The LPRng system has a compiled in set of defaults that should be
43suitable for most user applications.
44In 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>
49file contains the printer database information.
50This 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,
56since LPRng is a rapidly evolving package, I would advise you to check
57whether there is a newer stable version available on one of the
58<A HREF="LPRng-HOWTO-1.html#secftp">FTP sites.</A>
59There 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>
63to 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,
67you should read the
68<CODE>README.1st</CODE> and <CODE>README.installation</CODE>
69files in the distribution.
70If you have GNU Make, do:
71<PRE>
72./configure;
73  #if you want internationalization,
74  # ./configure --enable-nls
75make clean all;
76su   # you must do the following commands as root
77make install
78# if  you have not installed LPRng before,
79# install default lpd.perms and lpd.conf file in /etc
80if [ ! -f /etc/lpd.perms ]; then
81    make default;
82fi;
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
92make -f Makefile.bsd clean all;
93su   # you must do the following commands as root
94make -f Makefile.bsd install
95# if  you have not installed LPRng before,
96# install default lpd.perms and lpd.conf file in /etc
97if [ ! -f /etc/lpd.perms ]; then
98    make -f Makefile.bsd default;
99fi;
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
106the location of the binaries,
107or edit <CODE>src/Makefile</CODE> or
108<CODE>src/Makefile.bsd</CODE>
109after running configure.
110The lines you have to change are:
111<PRE>
112INSTALL_BIN =     ${exec_prefix}/bin
113# where daemons are installed: lpd
114#INSTALL_LIB =     ${prefix}/lib
115INSTALL_LIB =     ${prefix}/sbin
116# where maintenance commands are installed: checkpc, setstatus
117INSTALL_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.
126This is the standard compiler used for LPRng.
127Almost without exception,
128if you have a ANSI C compatible compiler and libraries
129a POSIX compatible standard set of system support routines,
130LPRng will compile and run out of the box.
131The main problems are with missing or modified system support routines,
132but configure will usually detect this and set flags to use
133suitable alternatives.</LI>
134<LI>The <CODE>configure</CODE> and the <CODE>make</CODE> should be run on
135the target host,
136especially if the target host has a different version of the operating system.
137This is extremely important for SunOS or Solaris,
138where
139there tend to be changes in the system's include files between
140versions
141as well as support libraries.</LI>
142<LI><CODE>configure</CODE>
143and the LPRng software tends to make the assumption that newer versions will not
144have 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>
150for 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
155HOWTO. Things will be a lot easier when you first set up the
156configuration files, and then start the new lpd.
157<P>During the course of these steps, you will have to change some files.
158Be 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
162to help you prepare your site for
163running the server.
164<OL>
165<LI>Kill off the old server.
166<PRE>
167BSD or Linux:
168  ps -aux |grep lpd
169  kill (pid of lpd server)
170System 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.
176Use the following script and
177examine the <CODE>/tmp/candidates</CODE> file for possible programs.
178Remove or rename the non-LPRng versions of the programs.
179<PRE>
180# you might want to track down the old lpr, lpq, lprm binaries
181find /usr -type file -name lp\* \; -print >/tmp/candidates
182find /sbin -type file -name lp\* \; -print >>/tmp/candidates
183
184# example rename
185mv /usr/libexec/lpd /usr/libexec/lpd.orig
186# example link
187ln -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.
191You should do the next steps as <B>root</B>.
192<PRE>
193/usr/local/bin/lpd;                # start up LPD
194lpq;                               # 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,
202i.e. - the <CODE>/etc/rc</CODE> file in most BSD based UNIX systems,
203or those in <CODE>/etc/init.d</CODE> or <CODE>/sbin/init.d</CODE> on System V and Linux.
204You will need to have them reference the LPRng <CODE>lpd</CODE>
205and not the original system executable.  For systems that use the System V
206run-level scripts, you will also likely need to install a symbolic link in the
207default 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
211that can be used to start up and shut down the server.
212Note that you will most likely need to modify the
213<CODE>echo</CODE> lines.
214<PRE>
215#!/bin/sh
216case "$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&lt;=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     ;;
235esac
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
242UNIX System V <CODE>lp</CODE> and <CODE>lpstat</CODE>
243programs.
244It is almost impossible to modify their operation to use the
245LPRng <CODE>lpr</CODE> or <CODE>lpq</CODE> programs,
246as they depend on various return codes and information.
247<P>Here are Patrick Powell's comments on this:
248<BLOCKQUOTE>
249After fighting with LP simulation,  I finally decided to make the
250interface part of the LPR/LPQ package.  If LPR is invoked as LP,
251then it will 'act' like a 'semi-compatible' LP; similarly for LPQ and LPSTAT,
252and LPRM and CANCEL.
253</BLOCKQUOTE>
254<P>To get this functionality, you need to either make a symbolic link
255or a hard link to the appropriate executable.
256<PRE>
257cd /usr/local/bin
258ln -s lpr lp
259ln -s lpq lpstat
260ln -s lprm cancel
261cd /usr/sbin
262ln -s /usr/local/bin/lpr lp
263ln -s /usr/local/bin/lpq lpstat
264ln -s /usr/local/bin/lprm cancel
265</PRE>
266<P>See the man pages for lp, lpstat, and cancel in the LPRng/man directory.
267Note that not all the functions of the original
268lp programs are supported.
269These man pages should be installed to replace the normal
270lp, etc, man pages.
271<P>For some purposes,  the rather rugged <CODE>lpstat</CODE>
272simulation provided by this method does not work.
273<A HREF="mailto:garrett@qualcomm.com">Garrett D'Amore &lt;garrett@qualcomm.com&gt;</A>
274has written some much improved versions;
275take a look at
276<A HREF="http://people.qualcomm.com/garrett/">http://people.qualcomm.com/garrett/</A>
277for 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,
283LPRng executables are installed setuid ROOT.
284When running,
285they normally perform all operations with the user's effective UID,
286and perform all other operations set to the user and group specified by the
287<CODE>user=daemon</CODE>
288and
289<CODE>group=daemon</CODE>
290printcap entries,
291except for a very few places where they take extreme precautions against
292actions that could cause security breaches,
293change the EUID to ROOT,
294and then immediately change back to the normal operation.
295<P>As a scan of the various CERT Security Advisories will indicate,
296many programs that run SUID root can be serious security loopholes.
297While LPRng has been designed and implemented with security and
298paranoia in mind,
299there is still the possibility that user level or LPD processes
300can have an exposed security loophole.
301<P>To reduce the risk,
302the user level utilities such as lpr, lprm, lpq, and lpc can be installed
303non-setuid.
304This effectively closes several possible security loopholes.
305To install the executables as non-setuid,
306the distribution <CODE>src/Makefile</CODE>
307must have the following lines commented out,
308and then LPRng must be reinstalled:
309<PRE>
310edit src/Makefile
311   # comment out the next line to have LPRng installed non-setuid
312   PERMS=$(SUID_ROOT_PERMS)
313make 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
320specific 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
325baseline.
326Use the following installation procedure.
327<OL>
328<LI>First,
329install the LPRng software
330and then rename all of the existing Solaris print facilities.
331See the
332<A HREF="#installation">Installation</A> section for details.
333You should especially look out for
334<CODE>lp</CODE>,
335<CODE>lpstat</CODE>,
336<CODE>lpsched</CODE>,
337<CODE>lpadmin</CODE>,
338and other executables used by Solaris for print support.</LI>
339<LI>Next,
340make sure you update the <CODE>/etc/rc</CODE> startup files.
341During the startup or initialization,
342Solaris will invoke a set of individual startup files.
343You will find that the startupfile files are usually links to a
344common 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
352lrwxrwxr-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>
359printer 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>.
365Don't try to be fancy and kill off processes,
366use the <EM>nlsadmin</EM> command,
367or other insanity.
368This is brutal,  but appears to be necessary in order to ensure
369that the networking support is set up correctly.</LI>
370<LI>When the system restarts, try using <CODE>lpq</CODE>
371to check to see if the <CODE>lpd</CODE> server is active.</LI>
372</OL>
373<P>James P. Dugal <CODE>&lt;jpd@usl.ed&gt;</CODE> has also makde the following
374suggestions as well.
375<PRE>
376From: "Dugal James P." &lt;jpd@usl.edu>
377To: lprng@iona.com
378Subject: Re: [LPRng] start up trouble
379
380Here are some more tips for Solaris:
381
3821. If /var/spool/cron/crontabs/lp exists, remove it.
383
384In fact, we actually test if /etc/init.d/lp exists on any newly-installed
385system, 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
394Regards,
395-- James Dugal, N5KNX           Internet: jpd@usl.edu
396Associate Director              Ham packet: n5knx@k5arh.#lft.la.usa.noam
397Computing Support Services      US Mail: PO Box 42770  Lafayette, LA  70504
398University 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
405Sun Microsystems Newsprint by
406Christopher Hylands, Ptolemy Project Manager
407of the University of California.
408<P>The Sun Newsprint printer is actually
409an OEM version of the  Textronix PhaserII;
410Sun Microsystems appears to have dropped support for Newsprint,
411and the recommended migration path is to buy a PostScript printer.
412If you want more information on using the Newsprint system,
413notes 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
416having a hard time getting lprng to work with Sun's braindead
417newsprinters.  I tried using ghostscript, but the fonts were, IMHO,
418ugly, 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>
421from a SunOS4.1.3 newsprint installation.
422If you cannot get this code,
423then the installation will be extremely difficult.
424<P>To install lprng on a Solaris2.x machine,
425you need to first stop the existing print services and install the
426startup scripts for LPRng.
427Note that if there is a local printer, you may have
428to also fix the permissions of the device. Typical commands are:
429<PRE>
430chown 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
439licensed fonts, you must have the lprng spool directory for the
440sparcprinter in the same location as spool directory of the brain
441dead Solaris lp system.  If your printer is named xsp524, then this
442directory would be <CODE> /etc/lp/printers/xsp524</CODE>.
443<P>The printcap entry looks like:
444<PRE>
445sp524|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:
450xsp524|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>
460was copied from
461<CODE>/usr/newsprint/lpd/if</CODE>
462in a SunOS4.x installation of the newsprint
463software.
464Unfortunately, the newsprint engine is so brain dead that it
465needs many environment variables set, so it is fairly difficult to
466come up with a clean script to start the engine. I made the following
467changes to the file.
468<OL>
469<LI>First, set the path in the script.
470You may also need to change defaults to suit your preferences:
471<PRE>
472PATH=/usr/ucb:/usr/bin:/etc:/usr/etc:/opt/NeWSprint/bin:/opt/NeWSprint/np/bin:
473PATH=$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>
478file. If you
479are using the same spooler directory as the directory that the Solaris
480lp system uses, then the .param file should appear there. If you are
481using a different spooler directory, then you will need to copy
482the .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
484probably save the .param file in the old printer spooler directory.
485Run /opt/NeWSprint/bin/fp_install and remove the license from the
486old printer and assign it to the new printer.
487You could run /opt/NeWSprint/bin/rm_np_printer and remove the printer,
488but 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>
492sunxm.s5.sparc)
493    lpr -P"$PRINTER" "$FILE"
494    #lp -c -d"$PRINTER" "$FILE"
495</PRE>
496</LI>
497</OL>
498
499<PRE>
500Christopher Hylands, Ptolemy Project Manager  University of California
501cxh@eecs.berkeley.edu                 US Mail: 558 Cory Hall #1770
502ph: (510)643-9841 fax:(510)642-2739       Berkeley, CA 94720-1770
503home: (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),
509the three major Linux
510distributions (Slackware, Red Hat and Debian) carry an older version
511of LPRng. Users of those systems should download the
512latest stable release, and install that instead of the distributed
513binaries.
514<P>This is mostly important for Slackware 3.2 users, as this version
515installs LPRng by default.
516Patrick Volkerding changed the default back to
517BSD LPR in Slackware 3.3,
518as many users had experienced problems
519because they didn't realize they weren't using the BSD software.
520<P>Debian's <CODE>dselect</CODE> utility lets you choose between all
521packages. Amongst these are LPRng, as well as the traditional LPR
522software.
523<P>You have to make sure your kernel is configured correctly. The
524documentation for the kernel sources in
525<CODE>/usr/src/linux/Documentation/</CODE> and the <CODE>Kernel-HOWTO</CODE>
526will help you to generate a new kernel if needed. You will need to set
527the 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
532need the `Parallel Printer Support' (<CODE>CONFIG_PRINTER</CODE>).
533You 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
536also available as a module.</LI>
537</UL>
538<P>Once you have done this,
539the current releases of LPRng will install and run without
540problems.
541See the
542<A HREF="LPRng-HOWTO-3.html#installingprograms">Installing the programs</A>
543section for details on how to install LPRng and
544deactivate the existing print support.
545<P>You may need to update the printcap file and filters.
546See
547<A HREF="#printcapref">/etc/printcap Print Spool Database File</A>
548for 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>,
554as of August 1997,
555and describes how to install the LPRng package on a workstation
556running AIX 4.1.x and possibly 3.x.x as well.
557Dirk would be interested in any comments or corrections.
558<P>Printing on AIX systems is different. AIX provides a general
559queueing facility and printing is only one way to use it. You submit a
560print job to a print queue using one of the commands
561<CODE>qprt</CODE>, <CODE>enq</CODE>. You can use the BSD or
562System V printing commands <CODE>lpr</CODE> or <CODE>lp</CODE>, too. The
563qdaemon watches all (general) queues and knows how to handle your
564job. A (general) queue is defined in the file
565<CODE>/etc/qconfig</CODE>. The format of this file is different from
566the <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
569group for file ownership and process permissions. We decided to use
570the <CODE>printq</CODE> group. The user <CODE>daemon</CODE> exists on
571AIX but we have chosen <CODE>lpd</CODE> as the user who runs
572<CODE>lpd</CODE> and all filters and owns the spooling directories.
573You 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)
580group=printq
581server_user=lpd
582user=lpd
583</PRE>
584
585Compile and install the LPRng package. Create your
586<CODE>printcap</CODE>, spooling directories, accounting and logfiles
587and so on.
588Don't forget to use
589<A HREF="LPRng-HOWTO-10.html#checkpc">checkpc</A> to make sure that all the
590permissions are set correctly and the necessary files
591are 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
597for 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,
600Manage 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
608system. 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
611rmpq</CODE>.
612<P>To start the new <CODE>lpd</CODE> at system startup you have to add
613an 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
618your workstation. You have to create a device file like
619<CODE>/dev/lp0</CODE>. The SMIT fast path for this is <CODE>smit
620mkdev</CODE>. Choose <CODE>Printer/Plotter</CODE> and then
621<CODE>Printer/Plotter Devices</CODE>. Now <CODE>Add a
622Printer/Plotter</CODE>. To create a parallel
623printer device select the following:
624<PRE>
625Plotter type:              opp Other parallel printer
626Printer/Plotter Interface: parallel
627Parent Adapter:            ppa0 Available
628</PRE>
629
630Now define the characteristictics of the device:
631<PRE>
632Port Number: p
633</PRE>
634
635(<CODE>p</CODE> is for parallel).
636Go to the field
637<PRE>
638Send all characters to printer UNMODIFIED   no
639</PRE>
640
641and select <CODE>yes</CODE>! We have had a lot of trouble with
642<CODE>no</CODE>.  This is very important! Expect erroneous output if
643you choose <CODE>no</CODE>. If you have already created a device
644file, change the characteristictics! SMIT's fast path is <CODE>smit
645chdev</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
650you 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
656Appletalk printers and vice versa.
657The 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
660has to do with printing to LPRng-served printers from Macs.
661The second issue has to do with printing from LPRng to
662network 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,
668you can use the following configuration file to print
669from a Macintosh to an LPRng printer.
670<PRE>
671From edan@mtu.edu Mon Sep 29 21:31:25 1997
672Date: Tue, 30 Sep 1997 00:04:58 -0400 (EDT)
673From: Edan Idzerda &lt;edan@mtu.edu>
674To: lprng@iona.com
675Subject: 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?
679Well, *I* use:
680Your 32 Character Printer Name:\
681        :pr=|/your/path/to/lpr -Pprintername
682        :ppd=/your/path/to/ppd/files/yourprinter.ppd
683--
684Edan Idzerda    &lt;edan@mtu.edu>
685System 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
691compilation, it is in (e.g.) <CODE>netatalk-1.4b2/etc/psf</CODE> and will be installed
692in (e.g.) <CODE>/usr/local/atalk/etc/</CODE>.  After installation, there will also
693be a directory <CODE>/usr/local/atalk/etc/filters</CODE> that contains
694<CODE>ifpap</CODE>, <CODE>ofpap</CODE>,
695et al.  These are just symlinks to <CODE>psf</CODE>, and <CODE>psf</CODE> will do the appropriate
696thing 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>
700dave|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
712in one of two ways.  The first is to uncomment the following line in
713src/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,
724you 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
729spool directory.  For instance, <CODE>/var/spool/dave/.paprc</CODE> looks like this:
730<PRE>
731Dave'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
738single printer, this can be <CODE>/dev/null</CODE>.  If the host spools to more
739than one AppleTalk printer, you shouldn't use <CODE>/dev/null</CODE> for lp.  You
740should use <CODE>mknod</CODE> to create a null device for each printer.  See psf(8).</LI>
741</OL>
742
743<PRE>
744Chad Mynhier &lt;mynhier@cs.utk.edu>
745Lab Engineer, CS Department       
746University 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>
753Web 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
759PC-related machines share files and printers and other information
760such as lists of available files and printers. Operating systems that
761support this natively include Windows NT, OS/2, and Linux and add on
762packages that achieve the same thing are available for DOS, Windows,
763VMS, Unix of all kinds, MVS, and more. There is no reason why Apple
764Macs and indeed any Web browser should not be able to speak this
765protocol, and current development (in which the Samba team is heavily
766involved) is aimed at exactly that. Alternatives to SMB include
767Netware, NFS, Appletalk, Banyan Vines, Decnet etc; many of these have
768advantages but none are both public specifications and widely
769implemented in desktop machines by default.
770<P>The Common Internet Filesystem is what the new SMB initiative is
771called. 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
777services 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
779browsing 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
781printers) 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>
786and browse the user survey.
787<P>Related packages include:
788<UL>
789<LI> smbfs, a linux-only filesystem allowing you to mount remote SMB
790filesystems from PCs on your linux box. This is included as standard with
791Linux 2.0 and later.</LI>
792<LI> tcpdump-smb, a extension to tcpdump to allow you to investigate SMB
793networking problems over netbeui and tcp/ip.</LI>
794<LI> smblib, a library of smb functions which are designed to make it
795easy to smb-ise any particular application. See
796ftp://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
800samba.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
805archives of the mailing list and a user survey that shows who else is using
806this package. Have you registered with the survey yet? :-)
807<P>It is maintained by Paul Blackman (thanks Paul!). You can contact him
808at 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
812documentation for details,  but you only need to modify
813the samba.conf file and put in the pathnames of the LPRng
814facilities.  The following is a sample.
815<P>
816<PRE>
817From: Sascha Ottolski &lt;alzhimer@cs.tu-berlin.de>
818To: lprng@iona.com
819Subject: Re: [LPRng] lprng-3.2.6 and smb on Linux
820webnut@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
841Note: the path= value specifies the spool directory where
842the print files are temporarily stored.  This should NOT
843be the LPRng spool directory,  but some other directory that
844Samba has write permissions for.
845</PRE>
846
847<PRE>
848Reply-To: "Pascal A. Dupuis" &lt;dupuis@lei.ucl.ac.be>
849To: papowell@astart2.astart.com
850Subject: 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
881config_file=.config
882eval `cat $config_file`
883# echo "server $server, service $service" 2>&amp;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
901and applications.
902<H2><A NAME="ss4.16">4.16 HP Deskjet</A>
903</H2>
904
905<P>
906<PRE>
907From: jarausch@igpm.rwth-aachen.de (Helmut Jarausch)
908Subject: Re: Using gs (ghostscript) as a filter?
909To: lprng@iona.com
910Cc: Rick Gaine &lt;rgaine@nbcs.rutgers.edu>
911Sender: majordomo-owner@iona.com
912Reply-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>
925djps
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
934nice -19 /usr/LOCAL/bin/gs -sDEVICE=cdj550 -sPAPERSIZE=a4 -sOutputFile=- -q -r300 -
935</PRE>
936
937<PRE>
938Helmut Jarausch
939Lehrstuhl f. Numerische Mathematik
940Institute of Technology
941RWTH Aachen
942D 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" &lt;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).
968The Windows (you are under Windows, right?) HP driver for 3Si/3Si MX
969PostScript should produce only PS level 1.
970<P>Beware: latest version of Adobe Windows PS driver produces *ONLY* PS
971level 2.
972<P>So, if you have (or receive) level 2 files, read them using ghostscript
973and print a screen dump :-) or as a bitmap.
974<P>You can too convert them into PDF (using either Adobe distiller or
975ghostscript ps2pdf) then use acroread to print the result. acroread can
976produce 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
978driven, it is only a driver problem.
979<P>I believe that HP had once a PS level2 update, but the price was so high
980that bying a new printer was a better solution!
981<PRE>
982Bertrand
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
993Olaf Lotzkat (Sysadm), Faculty of Computer Science, TU Dresden, Germany
994<CODE>&gt;Olaf_Lotzkat@inf.tu-dresden.de&lt;</CODE>.
995<PRE>
996# HP DeskJet 1600CM
997tinte|:
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
1012panel  or through a set of network files.  Here is a summary
1013of  the  methods  used  from  UNIX  systems, or when you are
1014desperate, 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.
1018Reset  the printer,
1019put it in offline mode.
1020and 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
1058in  the  bootptab  file.   To  use this, you must enable the
1059bootp  option  on  the printer.  The T144 option specifies a
1060file to be read from the bootp server.  This file is read by
1061using  the  TFTP  protocol, and you must have a TFTPD server
1062enabled.  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#
1093peripheral1:
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
1103the  configuration file.  The sample configuration file from
1104the 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
1120name: 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
1127location: 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
1135contact: 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:
1147allow: 10.0.0.0  255.0.0.0
1148
1149# to allow a single host without specifying the mask:
1150allow: 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
1156idle-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
1168get-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
1180set-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
1188trap-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
1194trap-dest: 15.1.2.3
1195trap-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
1202authentication-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
1213syslog-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
1227subnets-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
1234old-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
1240printer,  using the front panel switches,  to select the FIRST paper
1241tray.  See your printer documentation on this.  Unfortunately,  different
1242models 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
1248to do so.
1249Here is what is needed to force this.
1250<PRE>
1251Date: Wed, 21 Jan 1998 18:25:50 -0600 (CST)
1252From: Matt White &lt;whitem@bofh.usask.ca>
1253To: lprng@iona.com
1254Subject: Re: [LPRng] CTI-ifhp with Lexmark Optra N printer
1255
1256On 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
1266There is a fix for that...it is originally from the Lexmark 4039 series,
1267but it still works on the Optra S 1650 machines that we have (and should
1268work on the rest of the optra line).  Just send this little chunk of
1269postscript to the printer once:
1270
1271-----------snip----------
1272%! Postscript utility file to set the 4039 printer into synchronous mode
1273serverdict begin 0 exitserver
1274statusdict begin true setenginesync end
1275-----------snip----------
1276
1277Basically, it causes the printer to wait until it is finished printing
1278before actually reporting that it is done.  I've got 3 Optra S printers
1279running 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 &amp; 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.
1292You can open a TCP (stream) connection to port 9100 and send a file to be
1293printed on the connection.
1294<P>When a UDP datagram is sent to UDP Port 9101,
1295the printer resonds with status information.
1296This apparently is the poor man's SNMP,
1297but I digress.
1298Here is a clever implementation of a filter that handles this printer.
1299<PRE>
1300From: Russ Thacher &lt;thacher@brl.uiuc.edu>
1301To: lprng@iona.com
1302Subject: Re: [LPRng] Tektronix P450 &amp; psfilter
1303
1304Having only limited success with the psfilter UDP status port option, and
1305not satisfied with the overall slowness of sending print jobs out via
1306AppleShare with CAP, I (we) decided to roll our own filter for the Phaser
1307450 that speaks AppSocket (sending on TCP 9100, monitoring UDP 9101),
1308grabs reliable page counts and can tell the Phaser to switch to
1309transparency mode based upon LPRng queue alias ('qq' printcap option).
1310
1311Here's out printcap entry for the Phaser 450, using our filter:
1312
1313# Tektronix Phaser 450-2
1314phaser450-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
1320Attached is the Perl filter I wrote that has been very slightly modified
1321since its inception by Al Marquardt.  It's written with Solaris in mind
1322and is perhaps a little crude, but it works quite well for us.  Feel free
1323to modify/use it in any way you like- direct any and all comments to Al
1324Marquardt (almar@uiuc.edu).
1325
1326--
1327Russ Thacher
1328Systems Administrator, UIUC Bioacoustics Research Lab
1329
1330-------------- Filter -----------------
1331#!/usr/local/bin/perl5
1332
1333use Getopt::Std;
1334use Socket;
1335use Sys::Hostname;
1336
1337pop @ARGV;
1338
1339# Get all the filter options LPRng knows
1340
1341getopts('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];
1363if (length($sec)  == 1)  { $sec = "0$sec" }
1364if (length($min)  == 1)  { $min = "0$min" }
1365if (length($hour) == 1)  { $hour= "0$hour" }
1366if (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
1372print 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
1389if ($opt_P eq 'phaser450-1') {
1390  $printip = inet_aton($phaser4501);
1391}
1392elsif ($opt_P eq 'phaser450-2') {
1393  $printip = inet_aton($phaser4502);
1394}
1395
1396$printudppaddr = sockaddr_in($udpport, $printip);     
1397
1398socket(UDPSOCK, PF_INET, SOCK_DGRAM, $udpproto) or die $udpsockerr;
1399bind(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);
1407socket(TCPSOCK, PF_INET, SOCK_STREAM, $tcpproto) or die $tcpsockerr;
1408setsockopt(TCPSOCK, SOL_SOCKET, SO_KEEPALIVE, 0);
1409setsockopt(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
1414defined(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
1419while ($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
1430connect(TCPSOCK, $printtcppaddr) or die $tcpconnecterr;
1431select TCPSOCK;
1432$| = 1;
1433select STDOUT;
1434print TCPSOCK "%!\n";
1435print TCPSOCK "(%%\[ pagecount: )print statusdict /pagecount get exec ";
1436print TCPSOCK "(                )cvs print ";
1437print TCPSOCK "( \]%%) = flush\n";
1438$tcpout = &lt;TCPSOCK>;
1439if ($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];
1448if (length($sec)  == 1)  { $sec = "0$sec" }
1449if (length($min)  == 1)  { $min = "0$min" }
1450if (length($hour) == 1)  { $hour= "0$hour" }
1451if (length($mday) == 1)  { $mday= " $mday" }
1452
1453$datestamp = "$month $mday $hour:$min:$sec";
1454
1455# open LPRng accounting file
1456
1457if( defined( $opt_a ) &amp;&amp; $opt_a &amp;&amp; open ACCT, ">>$opt_a" ){
1458print ACCT "DEBUG: printer return string= $tcpout";
1459print 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"; 
1460close ACCT;
1461}
1462
1463# Start shoving data out to printer
1464
1465# Set print/transparency by queue name
1466
1467if ($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
1480while ($line = &lt;STDIN>) {
1481  print TCPSOCK $line;
1482}
1483
1484close 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
1492while ($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
1502socket(TCPSOCK, PF_INET, SOCK_STREAM, $tcpproto) or die $tcpsockerr;
1503connect(TCPSOCK, $printtcppaddr) or die $tcpconnecterr;
1504
1505print TCPSOCK "%!\n";
1506print TCPSOCK "(%%\[ pagecount: )print statusdict /pagecount get exec ";
1507print TCPSOCK "(                )cvs print ";
1508print TCPSOCK "( \]%%) = flush\n";
1509$tcpout = &lt;TCPSOCK>;
1510if ($tcpout =~ /%%\[ pagecount:.*/) {
1511  @tcparray = split /\s/, $tcpout;
1512  $pagecount2 = $tcparray[2];
1513}
1514
1515close 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];
1521if (length($sec)  == 1)  { $sec = "0$sec" }
1522if (length($min)  == 1)  { $min = "0$min" }
1523if (length($hour) == 1)  { $hour= "0$hour" }
1524if (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
1532if( defined( $opt_a ) &amp;&amp; $opt_a &amp;&amp; open ACCT, ">>$opt_a" ){
1533print ACCT "DEBUG: printer return string= $tcpout";
1534print 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";
1535close ACCT;
1536}
1537
1538# Write a 'Job End' line to the printer log
1539
1540print 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.
1547Some printers which do duplex printing require that you
1548send them special commands to force this mode.  This is
1549usually done by the FILTERS.  The CTI-ifhp (for HP PJL printers)
1550and psfilter (for PostScript Printers) make a stab at sending
1551the PJL or PostScript commands to the printer.  Many people have
1552reported problems doing duplex printing,  so  here is a check
1553list.
1554<OL>
1555<LI>Make sure you have enough memory for the worst case
1556print job.  Usually the printer has to rasterize both
1557pages before it can produce an impression.  It may require
1558much 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
1561is part of the job (PJL language at the start of the job,
1562postscript header, etc), or that the filter generates the
1563correct form.
1564<P>Note there is a PostScript Printer Description file (PPD) for
1565most printers that support PostScript,  and they even have the
1566PJL and PostScript code for this in the PPD file.
1567</LI>
1568<LI>It has been observed that even with what would apparently be
1569sufficient memory,  that many duplex jobs print 'oddly',
1570that they are not aligned on the same side in the same way,
1571etc etc.  This may not be the fault of the software,  but of the
1572support for duplex operation.</LI>
1573<LI>Get the source code for psfilter or CTI-ifhp filter,  and modify the
1574appropriate lines to send the appropriate "turn on duplex" strings
1575to the printer.</LI>
1576</OL>
1577<P>I know this is painful,  but until there is a uniform way to get the
1578correct commands extracted from either PPD or some other database then
1579this 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,
1587and to use the non-default TCP/IP ports for communication.
1588This facility allows a <EM>TESTVERSION</EM> to be run in parallel with the
1589normal LPRng software.
1590<P>To simplify testing and portability issues,
1591a simple test version of the spool queues and jobs has been supplied with the
1592LPRng distribution.
1593These 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>
1596environment variable to specify the location of the configuration file.
1597It will read this configuration file on startup and use the values
1598to override the normal defaults.
1599Since a user could maliciously set up their own configuration files
1600with values that could compromise system security,
1601it is strongly recommended that the test version is not made SETUID root.
1602In fact,
1603the LPRng code will chatter messages when the LPD_CONF ability is enabled
1604and 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,
1610and then explicitly request the generation of the test version:
1611<PRE>
1612cd src
1613rm ./vars.o
1614make TESTVERSION=yes
1615</PRE>
1616</LI>
1617<LI>Edit <CODE>src/Makefile</CODE>, and uncomment the indicated line.
1618Then run <CODE>make</CODE> to regenerate the distribution.
1619This 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
1632and files that need to be installed in the appropriate directory.
1633The following steps are used.
1634<OL>
1635<LI>First,
1636you need to set up your <CODE>HOST</CODE> environment variable to the fully
1637qualified domain name of your host
1638and your <CODE>USER</CODE> environment variable to your user name.
1639This is done in order to get values to put into the TESTVERSION configuration files.</LI>
1640<LI>In the <CODE>TESTSUPPORT</CODE> directory,
1641edit the <CODE>Makefile</CODE>,
1642and specify the location of the <CODE>TESTVERSION</CODE> spool queues.
1643The default location is <CODE>/tmp</CODE>;
1644since on most systems these files are deleted or are available to everybody,
1645a more secure location should most likely be used.
1646<B>DO NOT USE THE RAW TESTFILE DIRECTORY</B>.
1647These 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
1649location of the installed lpd.conf file.</LI>
1650<LI>In the <CODE>TESTSUPPORT</CODE> directory,
1651run <CODE>make</CODE>.
1652This 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
1686trying to do a port to a new or whacko version of a UNIX system.
1687LPRng has been tested on just about every version of UNIX that supports
1688POSIX capabilities,
1689and if it is having problems then most likely it is due to non-portability
1690issues.
1691However,
1692if you feel that your system is not POSIX compatible,
1693or you are having serious problems due to LPRng's use of the system facilities,
1694feel free to try the following tests.
1695<P>Needless to say,
1696if you identify problems,  please inform the developers and they will
1697most likely assist you in resolving them.
1698<P>Set your current directory to the location of the compiled <CODE>TESTVERSION</CODE>
1699executables.
1700Execute the various executables using <CODE>./cmd</CODE>,
1701or set <CODE>.</CODE> <B> as the first entry in the PATH </B>.
1702If it is not the first entry,
1703then the standard system executables will be used.
1704<OL>
1705<LI> Run <CODE>./checkpc -T /tmp/a</CODE>.
1706This will perform a limited set of tests of the LPRng functionality.
1707Note that some of them will fail as checkpc is not running SUID ROOT
1708and the <CODE>/tmp/a</CODE> is not a serial device.
1709ALL 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>
1712chown root checkpc
1713chmod u+s checkpc
1714./checkpc -T /tmp/a
1715</PRE>
1716
1717<P>The SETUID tests should now succeed.
1718If they do not,
1719then you have a VERY odd UNIX system,
1720and you are on your own on this one.
1721See 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
1729in order to cause the <CODE>open()</CODE> to succeed,
1730as most serial device drivers block when <CODE>DSR</CODE> is not enabled.
1731Check the messages concerning the <CODE>stty</CODE> actions.
1732Make sure that the appropriate changes have taken place.
1733<P>You may get errors about <EM>device lock</EM> failing.
1734This is due to whacko differences in the ways that different UNIX systems
1735(or versions of the same UNIX system) implement serial device locking.
1736My advice is to ignore this problem unless you INSIST on having multiple users
1737of the same serial printing port,
1738in which case you are asking for serious trouble,
1739and you are on your own.
1740I am not interested in patches or queries on problems on serial device locking
1741problems.
1742In fact,
1743this 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>
1750executables.
1751Execute the various executables using <CODE>./cmd</CODE>,
1752or set <CODE>.</CODE> <B> as the first entry in the PATH </B>.
1753If it is not the first entry,
1754then the standard system executables will be used.
1755<OL>
1756<LI> Run <CODE>./checkpc</CODE>.
1757this will print out the various values for the spool queues in the <CODE>TESTVERSION</CODE>
1758setup.
1759If the <CODE>t1</CODE>, <CODE>t2</CODE>,... spool queues are not displayed,
1760make sure that the LPD_CONF environment variable is set correctly and that you
1761are using the <CODE>TESTVERSION</CODE> executable.</LI>
1762<LI>Run <CODE>./checkpc -f</CODE>.
1763This will fix up the (deliberately introduced) problems in the spool queues.</LI>
1764<LI>Next, run <CODE>./lpd -F</CODE> in one window,
1765and then run <CODE>./lpq -a </CODE> in another window.
1766This will check that the server is working.</LI>
1767<LI>You can now amuse yourself by sending jobs,
1768setting up permissions checking,
1769and other chores.</LI>
1770<LI>When everything appears to be working correctly,
1771you can then remove the <CODE>TESTVERSION</CODE> flag from the
1772<CODE>src/Makefile</CODE>, recompile,
1773and 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>
Note: See TracBrowser for help on using the repository browser.