diff options
| author | Nik Clayton <nik@FreeBSD.org> | 1998-10-21 22:00:19 +0000 |
|---|---|---|
| committer | Nik Clayton <nik@FreeBSD.org> | 1998-10-21 22:00:19 +0000 |
| commit | 6d7e38c02a1910cf2e471fb960453259d05c0503 (patch) | |
| tree | ba5ab7d0cb17832167148b61745dd3a6785422c6 /en | |
| parent | cfb82ba9ca6e760d71f6a0c0f81cdf1dc9cdcfec (diff) | |
Notes
Diffstat (limited to 'en')
| -rw-r--r-- | en/handbook/README | 3 | ||||
| -rw-r--r-- | en/handbook/handbook.sgml | 1293 |
2 files changed, 681 insertions, 615 deletions
diff --git a/en/handbook/README b/en/handbook/README index ef5cfb8861..435b7183d9 100644 --- a/en/handbook/README +++ b/en/handbook/README @@ -453,3 +453,6 @@ for example, There are very few whitespace changes, although a few have probably cropped up. The vast majority of the whitespace changes will happen in one megacommit, hopefully some time next week. + +38. As above, to line 11490. + diff --git a/en/handbook/handbook.sgml b/en/handbook/handbook.sgml index 5330554136..0f867a0926 100644 --- a/en/handbook/handbook.sgml +++ b/en/handbook/handbook.sgml @@ -1701,8 +1701,8 @@ ftp:*:99:99::0:0:FTP:/cdrom:/nonexistent <para>For a proxy FTP server, you should usually give name of the server you really want as a part of the username, after an @-sign. The proxy server then 'fakes' the real server. An - example: Say you want to install from <hostid>ftp.freebsd.org</hostid>, using the - proxy FTP server <hostid>foo.bar.com</hostid>, listening on port 1234.</para> + example: Say you want to install from <hostid role="fqdn">ftp.freebsd.org</hostid>, using the + proxy FTP server <hostid role="fqdn">foo.bar.com</hostid>, listening on port 1234.</para> <para>In this case, you go to the options menu, set the FTP username to ftp@ftp.freebsd.org, and the password to your e-mail @@ -1711,9 +1711,10 @@ ftp:*:99:99::0:0:FTP:/cdrom:/nonexistent <informalexample> <screen><userinput>ftp://foo.bar.com:1234/pub/FreeBSD</userinput></screen> - </informalexample> <filename>/pub/FreeBSD</filename> from <hostid>ftp.freebsd.org</hostid> is proxied - under <hostid>foo.bar.com</hostid>, allowing you to install from _that_ machine - (which fetch the files from <hostid>ftp.freebsd.org</hostid> as your installation + </informalexample> <filename>/pub/FreeBSD</filename> from + <hostid role="fqdn">ftp.freebsd.org</hostid> is proxied + under <hostid role="fqdn">foo.bar.com</hostid>, allowing you to install from _that_ machine + (which fetch the files from <hostid role="fqdn">ftp.freebsd.org</hostid> as your installation requests them).</para> </sect3> @@ -2831,7 +2832,7 @@ do-install: tell the port to fetch them from servers other than ones listed in the MASTER_SITES?</para> - <para>A. Yes. If you know, for example, <hostid>ftp.FreeBSD.ORG</hostid> is much + <para>A. Yes. If you know, for example, <hostid role="fqdn">ftp.FreeBSD.ORG</hostid> is much closer than sites listed in <makevar>MASTER_SITES</makevar>, do as following example. @@ -5047,7 +5048,7 @@ HULL NAY YANG TREE TOUT VETO</screen> <para>Before explaining how to generate one-time passwords, we should go over an S/Key login prompt:</para> - <para> + <informalexample> <screen>&prompt.user; <userinput>telnet himalia</userinput> Trying 18.26.0.186... @@ -5056,7 +5057,7 @@ Escape character is '^]'. s/key 92 hi52030 <prompt>Password:</prompt></screen> </informalexample> - </para> + <para>Note that, before prompting for a password, the login program prints out the iteration number and seed which you will need in @@ -5069,8 +5070,8 @@ s/key 92 hi52030 <para>If this machine were configured to disallow UNIX passwords over a connection from my machine, the prompt would have also - included the annotation <emphasis remap=tt>(s/key - required)</emphasis>, indicating that only S/Key one-time + included the annotation <literal>(s/key + required)</literal>, indicating that only S/Key one-time passwords will be accepted.</para> </sect2> @@ -5084,21 +5085,21 @@ s/key 92 hi52030 machines, and there is an S/Key desk accessory for Macintosh computers as well.) The command-line <command>key</command> program takes as its parameters the iteration count and seed; you can cut-and-paste right from the - login prompt starting at <emphasis remap=tt>key</emphasis> to + login prompt starting at <literal>key</literal> to the end of the line. Thus:</para> - <para> + <informalexample> <screen>&prompt.user; <userinput>key 92 hi52030</userinput> ) pasted from previous section Reminder - Do not use this program while logged in via telnet or rlogin. <prompt>Enter secret password:</prompt> ) I typed my secret password ADEN BED WOLF HAW HOT STUN</screen> </informalexample> - </para> + <para>And in the other window:</para> - <para> + <informalexample> <screen>s/key 92 hi52030 ) from previous section <prompt>Password:</prompt> @@ -5107,7 +5108,7 @@ ADEN BED WOLF HAW HOT STUN</screen> Last login: Wed Jun 28 15:31:00 from halloran-eldar.l [etc.]</screen> </informalexample> - </para> + <para>This is the easiest mechanism <emphasis>if</emphasis> you have a trusted machine. There is a Java S/Key <command>key</command> applet, <ulink @@ -5126,7 +5127,7 @@ Last login: Wed Jun 28 15:31:00 from halloran-eldar.l number of one-time passwords in the same command; these can then be printed out. For example:</para> - <para> + <informalexample> <screen>&prompt.user; <userinput>key -n 25 57 zz99999</userinput> Reminder - Do not use this program while logged in via telnet or rlogin. @@ -5137,7 +5138,7 @@ Reminder - Do not use this program while logged in via telnet or rlogin. 56: AMOS BOWL LUG FAT CAIN INCH 57: GROW HAYS TUN DISH CAR BALM</screen> </informalexample> - </para> + <para>The <option>-n 25</option> requests twenty-five keys in sequence; the <option>57</option> indicates the @@ -5158,7 +5159,7 @@ Reminder - Do not use this program while logged in via telnet or rlogin. can be used to configure restrictions on the use of UNIX passwords based on the host name, user name, terminal port, or IP address of a login session. The complete format of the file is documented in - the <filename>skey.access</filename>(5) manual page; there are + the <citerefentry><refentrytitle>skey.access</refentrytitle><manvolnum>5</manvolnum></citerefentry> manual page; there are also some security cautions there which should be read before depending on this file for security.</para> @@ -5225,10 +5226,10 @@ permit port ttyd0 countries.</para> <para>For those needing to get a legal foreign distribution of this - software, please <emphasis>DO NOT</emphasis> get it from a USA or + software, please <emphasis>do not</emphasis> get it from a USA or Canada site. You will get that site in <emphasis>big</emphasis> trouble! A legal copy of this is available from - <filename>skeleton.mikom.csir.co.za</filename>, which is in South + <hostid role="fqdn">skeleton.mikom.csir.co.za</hostid>, which is in South Africa.</para> @@ -5240,20 +5241,19 @@ permit port ttyd0 change to the directory <filename>/etc/kerberosIV</filename> and check that only the following files are present:</para> - <para> + <informalexample> <screen>&prompt.root; <userinput>cd /etc/kerberosIV</userinput> &prompt.root; <userinput>ls</userinput> README krb.conf krb.realms</screen> </informalexample> - </para> + <para>If any additional files (such as <filename>principal.*</filename> or <symbol>master_key</symbol>) exist, then use the <symbol>kdb_destroy</symbol> command to destroy the old Kerberos database, of if Kerberos is not running, - simply delete the extra files with <emphasis - remap=tt>rm</emphasis>.</para> + simply delete the extra files with <command>rm</command>.</para> <para>You should now edit the <filename>krb.conf</filename> and <filename>krb.realms</filename> files to define your Kerberos @@ -5284,14 +5284,14 @@ ARC.NASA.GOV trident.arc.nasa.gov</screen> <para>The first line names the realm in which this system works. The other lines contain realm/host entries. The first item on a line is a realm, and the second is a host in that realm that is acting - as a <quote>key distribution centre</quote>. The words <quote>admin server</quote> + as a <quote>key distribution centre</quote>. The words <literal>admin server</literal> following a hosts name means that host also provides an administrative database server. For further explanation of these terms, please consult the Kerberos man pages.</para> - <para>Now we have to add <filename>grunt.grondar.za</filename> to + <para>Now we have to add <hostid role="fqdn">grunt.grondar.za</hostid> to the <filename>GRONDAR.ZA</filename> realm and also add an entry to - put all hosts in the <filename>.grondar.za</filename> domain in + put all hosts in the <hostid role="domainname">.grondar.za</hostid> domain in the <filename>GRONDAR.ZA</filename> realm. The <filename>krb.realms</filename> file would be updated as follows:</para> @@ -5315,7 +5315,7 @@ grunt.grondar.za GRONDAR.ZA <para>Now we are ready to create the database. This only needs to run on the Kerberos server (or Key Distribution Centre). Issue the - <symbol>kdb_init</symbol> command to do this:</para> + <command>kdb_init</command> command to do this:</para> <informalexample> <screen>&prompt.root; <userinput>kdb_init</userinput> @@ -5348,8 +5348,8 @@ Master key entered. BEWARE!</screen> <title>Making it all run</title> <para>Two principals need to be added to the database for <emphasis>each</emphasis> system that will be secured with - Kerberos. Their names are <command>kpasswd</command> - and <command>rcmd</command> These two principals are + Kerberos. Their names are <literal>kpasswd</literal> + and <literal>rcmd</literal> These two principals are made for each system, with the instance being the name of the individual system.</para> @@ -5360,7 +5360,7 @@ Master key entered. BEWARE!</screen> <para>Now let's add these entries:</para> - <para> + <informalexample> <screen>&prompt.root; <userinput>kdb_edit</userinput> Opening database... @@ -5411,7 +5411,7 @@ Principal's new key version = 1 Edit O.K. <prompt>Principal name:</prompt> <---- null entry here will cause an exit</screen> </informalexample> - </para> + </sect2> @@ -5566,8 +5566,7 @@ Password changed.</screen> <title>Adding <command>su</command> privileges</title> <para>Kerberos allows us to give <emphasis>each</emphasis> - user who needs root privileges their own <emphasis - remap=it>separate</emphasis> <command>su</command>password. We could now add an id which is + user who needs root privileges their own <emphasis>separate</emphasis> <command>su</command>password. We could now add an id which is authorized to <command>su</command> to <username>root</username>. This is controlled by having an instance of <username>root</username> associated with a principal. Using <command>kdb_edit</command> we can create the @@ -5644,16 +5643,13 @@ May 2 20:43:12 May 3 04:43:12 krbtgt.GRONDAR.ZA@GRONDAR.ZA</screen> <sect2> <title>Using other commands</title> - <para>In an earlier example, we created a principal called <emphasis - remap=tt>jane</emphasis> with an instance <emphasis - remap=tt>root</emphasis>. This was based on a user with the same + <para>In an earlier example, we created a principal called + <literal>jane</literal> with an instance <literal>root</literal>. This was based on a user with the same name as the principal, and this is a Kerberos default; that a - <emphasis><principal>.<instance></emphasis> of the - form <emphasis><username>.</emphasis><emphasis - remap=tt>root</emphasis> will allow that - <emphasis><username></emphasis> to <command>su</command> to root if the necessary entries are in - the <filename>.klogin</filename> file in <emphasis - remap=tt>root</emphasis>'s home directory:</para> + <literal><principal>.<instance></literal> of the + form <literal><username>.</literal><literal>root</literal> will allow that + <literal><username></literal> to <command>su</command> to root if the necessary entries are in + the <filename>.klogin</filename> file in <username>root</username>'s home directory:</para> <informalexample> <screen>&prompt.root; <userinput>cat /root/.klogin</userinput> @@ -5671,10 +5667,10 @@ jack@GRONDAR.ZA</screen> <para>This allows anyone in the <filename>GRONDAR.ZA</filename> realm who has authenticated themselves to - <emphasis>jane</emphasis> or <emphasis>jack</emphasis> (via + <username>jane</username> or <username>jack</username> (via <command>kinit</command>, see above) access to <command>rlogin</command> to - <emphasis>jane</emphasis>'s account or files on this system + <username>jane</username>'s account or files on this system (<hostid>grunt</hostid>) via <command>rlogin</command>, <command>rsh</command> or <command>rcp</command>.</para> @@ -5745,16 +5741,16 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>There are currently two distinct types of firewalls in common use on the Internet today. The first type is more properly called - a <emphasis remap=bf>packet filtering router</emphasis>, where the + a <emphasis>packet filtering router</emphasis>, where the kernel on a multi-homed machine chooses whether to forward or block packets based on a set of rules. The second type, known as - <emphasis remap=bf>proxy servers</emphasis>, rely on daemons to + <emphasis>proxy servers</emphasis>, rely on daemons to provide authentication and to forward packets, possibly on a multi-homed machine which has kernel packet forwarding disabled.</para> <para>Sometimes sites combine the two types of firewalls, so that - only a certain machine (known as a <emphasis remap=bf>bastion + only a certain machine (known as a <emphasis>bastion host</emphasis>) is allowed to send packets through a packet filtering router onto an internal network. Proxy services are run on the bastion host, which are generally more secure than normal @@ -5806,7 +5802,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>Proxy servers are machines which have had the normal system daemons (telnetd, ftpd, etc) replaced with special servers. - These servers are called <emphasis remap=bf>proxy + These servers are called <emphasis>proxy servers</emphasis> as they normally only allow onward connections to be made. This enables you to run (for example) a proxy telnet server on your firewall host, and people can telnet @@ -5874,7 +5870,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>There are currently three kernel configuration options relevant to IPFW:</para> - <para> + <variablelist> <varlistentry><term>options IPFIREWALL</term> <listitem> @@ -5918,10 +5914,10 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </varlistentry> </variablelist> - </para> + <para>Previous versions of FreeBSD contained an - <symbol>IPFIREWALL_ACCT</symbol> option. This is now obsolete as + <literal>IPFIREWALL_ACCT</literal> option. This is now obsolete as the firewall code automatically includes accounting facilities.</para> @@ -5964,7 +5960,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>There is one valid flag when using this form of the command:</para> - <para> + <variablelist> <varlistentry><term>-N</term> <listitem> @@ -5974,13 +5970,13 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </varlistentry> </variablelist> - </para> + <para>The <emphasis>command</emphasis> given can be shortened to the shortest unique form. The valid <emphasis>commands</emphasis> are:</para> - <para> + <variablelist> <varlistentry><term>add</term> <listitem> @@ -5997,25 +5993,25 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </varlistentry> </variablelist> - </para> + <para>Previous versions of <application>IPFW</application> used separate firewall and accounting entries. The present version provides packet accounting with each firewall entry.</para> - <para>If an <emphasis remap=tt>index</emphasis> value is supplied, + <para>If an <emphasis>index</emphasis> value is supplied, it used to place the entry at a specific point in the chain. Otherwise, the entry is placed at the end of the chain at an index 100 greater than the last chain entry (this does not include the default policy, rule 65535, deny).</para> - <para>The <emphasis remap=bf>log</emphasis> option causes matching + <para>The <literal>log</literal> option causes matching rules to be output to the system console if the kernel was - compiled with <symbol>IPFIREWALL_VERBOSE</symbol>.</para> + compiled with <literal>IPFIREWALL_VERBOSE</literal>.</para> <para>Valid <emphasis>actions</emphasis> are:</para> - <para> + <variablelist> <varlistentry><term>reject</term> <listitem> @@ -6028,9 +6024,8 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <varlistentry><term>allow</term> <listitem> - <para>Pass the packet on as normal. (aliases: <emphasis - remap=bf>pass</emphasis> and <emphasis - remap=bf>accept</emphasis>)</para> + <para>Pass the packet on as normal. (aliases: + <literal>pass</literal> and <literal>accept</literal>)</para> </listitem> </varlistentry> @@ -6052,7 +6047,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </varlistentry> </variablelist> - </para> + <para>Each <emphasis>action</emphasis> will be recognized by the shortest unambiguous prefix.</para> @@ -6060,7 +6055,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>The <emphasis>protocols</emphasis> which can be specified are:</para> - <para> + <variablelist> <varlistentry><term>all</term> <listitem> @@ -6089,7 +6084,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </varlistentry> </variablelist> - </para> + <para>The <emphasis>address</emphasis> specification is:</para> @@ -6105,41 +6100,41 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> conjunction with <emphasis>protocols</emphasis> which support ports (UDP and TCP).</para> - <para>The <emphasis remap=bf>via</emphasis> is optional and may + <para>The <option>via</option> is optional and may specify the IP address or domain name of a local IP interface, - or an interface name (e.g. <emphasis remap=tt>ed0</emphasis>) to + or an interface name (e.g. <devicename>ed0</devicename>) to match only packets coming through this interface. Interface unit numbers can be specified with an optional wildcard. For example, - <emphasis remap=tt>ppp*</emphasis> would match all kernel PPP + <literal>ppp*</literal> would match all kernel PPP interfaces.</para> <para>The syntax used to specify an <replaceable>address/mask</replaceable> is: <informalexample> - <screen>address</screen> + <screen><replaceable>address</replaceable></screen> </informalexample> or <informalexample> - <screen>address/mask-bits</screen> + <screen><replaceable>address</replaceable>/<replaceable>mask-bits</replaceable></screen> </informalexample> or <informalexample> - <screen>address:mask-pattern</screen> + <screen><replaceable>address</replaceable>:<replaceable>mask-pattern</replaceable></screen> </informalexample></para> <para>A valid hostname may be specified in place of the IP - address. <emphasis remap=tt>mask-bits</emphasis> is a decimal + address. <option><replaceable>mask-bits</replaceable></option> is a decimal number representing how many bits in the address mask should be - set. e.g. specifying <literal> 192.216.222.1/24</literal> will create a mask which will allow any + set. e.g. specifying <literal>192.216.222.1/24</literal> will create a mask which will allow any address in a class C subnet (in this case, 192.216.222) to be - matched. <emphasis remap=tt>mask-pattern</emphasis> is an IP + matched. <option><replaceable>mask-pattern</replaceable></option> is an IP address which will be logically AND'ed with the address given. - The keyword <emphasis remap=tt>any</emphasis> may be used to + The keyword <literal>any</literal> may be used to specify <quote>any IP address</quote>.</para> <para>The port numbers to be blocked are specified as: @@ -6157,7 +6152,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>The <emphasis>options</emphasis> available are:</para> - <para> + <variablelist> <varlistentry><term>frag</term> <listitem> @@ -6180,18 +6175,18 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </varlistentry> - <varlistentry><term>ipoptions <emphasis>spec</emphasis></term> + <varlistentry><term>ipoptions <replaceable>spec</replaceable></term> <listitem> <para>Matches if the IP header contains the comma separated list of options specified in - <emphasis>spec</emphasis>. The supported list of IP - options are: <emphasis remap=bf>ssrr</emphasis> (strict - source route), <emphasis remap=bf>lsrr</emphasis> (loose - source route), <emphasis remap=bf>rr</emphasis> (record - packet route), and <emphasis remap=bf>ts</emphasis> + <replaceable>spec</replaceable>. The supported list of IP + options are: <literal>ssrr</literal> (strict + source route), <literal>lsrr</literal> (loose + source route), <literal>rr</literal> (record + packet route), and <literal>ts</literal> (timestamp). The absence of a particular option may be - denoted with a leading '!'.</para> + denoted with a leading <literal>!</literal>.</para> </listitem> </varlistentry> @@ -6215,39 +6210,35 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </varlistentry> - <varlistentry><term>tcpflags <emphasis>flags</emphasis></term> + <varlistentry><term>tcpflags <replaceable>flags</replaceable></term> <listitem> <para>Matches if the TCP header contains the comma - separated list of <emphasis>flags</emphasis>. The - supported flags are <emphasis remap=bf>fin</emphasis>, - <emphasis remap=bf>syn</emphasis>, <emphasis - remap=bf>rst</emphasis>, <emphasis - remap=bf>psh</emphasis>, <emphasis - remap=bf>ack</emphasis>, and <emphasis - remap=bf>urg</emphasis>. The absence of a particular - flag may be indicated by a leading '!'.</para> + separated list of <replaceable>flags</replaceable>. The + supported flags are <literal>fin</literal>, + <literal>syn</literal>, <literal>rst</literal>, + <literal>psh</literal>, <literal>ack</literal>, and + <literal>urg</literal>. The absence of a particular + flag may be indicated by a leading <literal>!</literal>.</para> </listitem> </varlistentry> - <varlistentry><term>icmptypes - <emphasis>types</emphasis></term> + <varlistentry><term>icmptypes <replaceable>types</replaceable></term> <listitem> <para>Matches if the ICMP type is present in the list - <emphasis>types</emphasis>. The list may be specified + <replaceable>types</replaceable>. The list may be specified as any combination of ranges and/or individual types separated by commas. Commonly used ICMP types are: - <emphasis remap=bf>0</emphasis> echo reply (ping reply), - <emphasis remap=bf>5</emphasis> redirect, <emphasis - remap=bf>8</emphasis> echo request (ping request), and - <emphasis remap=bf>11</emphasis> time exceeded (used to + <literal>0</literal> echo reply (ping reply), + <literal>5</literal> redirect, <literal>8</literal> echo request (ping request), and + <literal>11</literal> time exceeded (used to indicate TTL expiration as with <citerefentry><refentrytitle>traceroute</refentrytitle><manvolnum>8</manvolnum></citerefentry>).</para> </listitem> </varlistentry> </variablelist> - </para> + </sect3> @@ -6266,7 +6257,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>There are three valid flags when using this form of the command:</para> - <para> + <variablelist> <varlistentry><term>-a</term> <listitem> @@ -6292,7 +6283,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </varlistentry> </variablelist> - </para> + </sect3> @@ -6320,7 +6311,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <cmdsynopsis> <command>ipfw</command> <arg choice="plain">zero</arg> - <arg><replaceable>index</replaceable></arg> + <arg choice="opt"><replaceable>index</replaceable></arg> </cmdsynopsis></para> <para>When used without an <replaceable>index</replaceable> argument, @@ -6335,8 +6326,8 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <title>Example commands for ipfw</title> <para>This command will deny all packets from the host - <filename>evil.hacker.org</filename> to the telnet port of the - host <filename>nice.people.org</filename> by being forwarded by + <hostid role="fqdn">evil.hacker.org</hostid> to the telnet port of the + host <hostid role="fqdn">nice.people.org</hostid> by being forwarded by the router:</para> <informalexample> @@ -6344,8 +6335,8 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </informalexample> <para>The next example denies and logs any TCP traffic from the - entire <filename>hacker.org</filename> network (a class C) to the - <filename>nice.people.org</filename> machine (any port).</para> + entire <hostid role="domainname">hacker.org</hostid> network (a class C) to the + <hostid role="fqdn">nice.people.org</hostid> machine (any port).</para> <informalexample> <screen>&prompt.root; <userinput>ipfw add deny log tcp from evil.hacker.org/24 to nice.people.org</userinput></screen> @@ -6360,13 +6351,16 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </informalexample> <para>To see the accounting records: + <informalexample> <screen>&prompt.root; <userinput>ipfw -a list</userinput></screen> </informalexample> or in the short form + <informalexample> <screen>&prompt.root; <userinput>ipfw -a l</userinput></screen> </informalexample> You can also see the last time a chain entry was matched with + <informalexample> <screen>&prompt.root; <userinput>ipfw -at l</userinput></screen> </informalexample></para> @@ -6394,8 +6388,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> rules if your requirements alter.</para> <note> - <para>If you use the logging versions of the <emphasis - remap=bf>accept</emphasis> command, it can generate + <para>If you use the logging versions of the <command>accept</command> command, it can generate <emphasis>large</emphasis> amounts of log data as one log line will be generated for every packet that passes through the firewall, so large ftp/http transfers, etc, will really slow the @@ -6424,18 +6417,18 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </informalexample> <para>to write a list of the current rules out to a file, and then - use a text editor to prepend `<literal>ipfw - </literal>' before all the lines. This will allow the script to + use a text editor to prepend <literal>ipfw + </literal> before all the lines. This will allow the script to be fed into /bin/sh and reload the rules into the kernel. Perhaps not the most efficient way, but it works.</para> <para>The next problem is what your firewall should actually - <emphasis>DO</emphasis>! This is largely dependent on what access to + <emphasis>do</emphasis>! This is largely dependent on what access to your network you want to allow from the outside, and how much access to the outside world you want to allow from the inside. Some general rules are:</para> - <para> + <itemizedlist> <listitem> @@ -6445,7 +6438,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> <listitem> - <para>Block <emphasis remap=bf>all</emphasis> incoming UDP + <para>Block <emphasis>all</emphasis> incoming UDP traffic. There are very few useful services that travel over UDP, and what useful traffic there is is normally a security threat (e.g. Suns RPC and NFS protocols). This has its @@ -6478,7 +6471,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </itemizedlist> - </para> + <para>Another checklist for firewall configuration is available from CERT at <ulink @@ -6520,7 +6513,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>LPD controls everything about a host's printers. It is responsible for a number of things:</para> - <para> + <itemizedlist> <listitem> @@ -6566,7 +6559,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </itemizedlist> - </para> + <para>Through a configuration file, and by providing the special filter programs, you can enable the LPD system to do all or some @@ -6584,7 +6577,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> to enable direct access to a printer, you should use the spooler anyway since</para> - <para> + <itemizedlist> <listitem> @@ -6608,7 +6601,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </itemizedlist> - </para> + </sect1> @@ -6620,7 +6613,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> set up both your printer hardware and the LPD software. This document describes two levels of setup:</para> - <para> + <itemizedlist> <listitem> @@ -6639,7 +6632,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </itemizedlist> - </para> + </sect1> @@ -6702,7 +6695,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>Nearly all printers you can get for a PC today support one or both of the following interfaces:</para> - <para> + <itemizedlist> <listitem> @@ -6729,7 +6722,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </itemizedlist> - </para> + <para>In general, serial interfaces are slower than parallel interfaces. Parallel interfaces usually offer just one-way @@ -6756,7 +6749,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>So, which interface should you use?</para> - <para> + <itemizedlist> <listitem> @@ -6778,7 +6771,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> </listitem> </itemizedlist> - </para> + </sect3> @@ -6792,8 +6785,8 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> should give you complete guidance.</para> <para>Remember which parallel port you used on the computer. The - first parallel port is /dev/lpt0 to FreeBSD; the second is - /dev/lpt1, and so on.</para> + first parallel port is <filename>/dev/lpt0</filename> to FreeBSD; the second is + <filename>/dev/lpt1</filename>, and so on.</para> </sect3> @@ -6814,7 +6807,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>A <emphasis>modem</emphasis> cable connects each pin of the connector on one end of the cable straight through to its corresponding pin of the connector on the other - end. This type of cable is also known as a DTE-to-DCE + end. This type of cable is also known as a <quote>DTE-to-DCE</quote> cable.</para> </listitem> @@ -6823,7 +6816,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> pins straight through, swaps others (send data to receive data, for example), and shorts some internally in each connector hood. This type of cable is also known as a - DTE-to-DTE cable.</para> + <quote>DTE-to-DTE</quote> cable.</para> </listitem> <listitem> @@ -6843,7 +6836,7 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> the printer can support. Choose 7 or 8 data bits; none, even, or odd parity; and 1 or 2 stop bits. Also choose a flow control protocol: either none, or XON/XOFF (also known as - <emphasis>in-band</emphasis> or <emphasis>software</emphasis>) + <quote>in-band</quote> or <quote>software</quote>) flow control. Remember these settings for the software configuration that follows.</para> @@ -6857,40 +6850,39 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>This section describes the software setup necessary to print with the LPD spooling system in FreeBSD.</para> - <para>Here is an outline of the steps involved: - <orderedlist> + <para>Here is an outline of the steps involved:</para> + + <procedure> - <listitem> + <step> <para>Configure your kernel, if necessary, for the port you are using for the printer; section <xref linkend="printing-kernel" remap="Kernel Configuration"> tells you what you need to do.</para> - </listitem> + </step> - <listitem> + <step> <para>Set the communications mode for the parallel port, if you are using a parallel port; section <xref linkend="printing-parallel-port-mode" remap="Setting the Communication Mode for the Parallel Port"> gives details.</para> - </listitem> + </step> - <listitem> + <step> <para>Test if the operating system can send data to the printer. Section <xref linkend="printing-testing" remap="Checking Printer Communications"> gives some suggestions on how to do this.</para> - </listitem> + </step> - <listitem> + <step> <para>Set up LPD for the printer by modifying the file <filename>/etc/printcap</filename>. Section <xref linkend="printing-printcap" remap="The /etc/printcap File"> shows you how.</para> - </listitem> + </step> - </orderedlist> - </para> - + </procedure> <sect3 id="printing-kernel"> @@ -6904,11 +6896,13 @@ FreeBSD BUILT-19950429 (GR386) #0: Sat Apr 29 17:50:09 SAT 1995</screen> <para>To find out if the kernel you are currently using supports a serial interface, type + <informalexample> <screen>&prompt.root; <userinput>dmesg | grep sio<replaceable>N</replaceable></userinput></screen> </informalexample> where <replaceable>N</replaceable> is the number of the serial port, starting from zero. If you see output similar to the following + <informalexample> <screen>sio2 at 0x3e8-0x3ef irq 5 on isa sio2: type 16550A</screen> @@ -6916,11 +6910,13 @@ sio2: type 16550A</screen> <para>To find out if the kernel supports a parallel interface, type + <informalexample> <screen>&prompt.root; <userinput>dmesg | grep lpt<replaceable>N</replaceable></userinput></screen> </informalexample> where <replaceable>N</replaceable> is the number of the parallel port, starting from zero. If you see output similar to the following + <informalexample> <screen>lpt0 at 0x378-0x37f on isa</screen> </informalexample> then the kernel supports the port.</para> @@ -6946,25 +6942,28 @@ sio2: type 16550A</screen> send and receive data. That is what entries in the <filename>/dev</filename> directory are for.</para> - <para><emphasis remap=bf>To add a <filename>/dev</filename> - entry for a port:</emphasis> - <orderedlist> + <para><emphasis>To add a <filename>/dev</filename> + entry for a port:</emphasis></para> + + <procedure> - <listitem> + <step> <para>Become root with the <citerefentry> <refentrytitle>su</refentrytitle></citerefentry> command. Enter the root password when prompted.</para> - </listitem> + </step> - <listitem> + <step> <para>Change to the <filename>/dev</filename> directory: + <informalexample> <screen>&prompt.root; cd /dev</screen> </informalexample></para> - </listitem> + </step> - <listitem> + <step> <para>Type + <informalexample> <screen>&prompt.root; <userinput>./MAKEDEV <replaceable>port</replaceable></userinput></screen> </informalexample> where <replaceable>port</replaceable> is the device entry for the @@ -6973,18 +6972,18 @@ sio2: type 16550A</screen> so on; use <literal>ttyd0</literal> for the first serial port, <literal>ttyd1</literal> for the second, and so on.</para> - </listitem> + </step> - <listitem> + <step> <para>Type + <informalexample> <screen>&prompt.root; <userinput>ls -l <replaceable>port</replaceable></userinput></screen> </informalexample> to make sure the device entry got created.</para> - </listitem> + </step> - </orderedlist> - </para> + </procedure> </sect4> @@ -6997,7 +6996,7 @@ sio2: type 16550A</screen> whether FreeBSD should use interrupt-driven or polled communication with the printer.</para> - <para> + <itemizedlist> <listitem> @@ -7015,7 +7014,7 @@ sio2: type 16550A</screen> </listitem> </itemizedlist> - </para> + <para>The interrupt-driven method is somewhat faster but uses up a precious IRQ line. You should use whichever one @@ -7027,11 +7026,12 @@ sio2: type 16550A</screen> <para>program.</para> - <para><emphasis remap=bf>To set the communications mode by - configuring the kernel:</emphasis> - <orderedlist> + <para><emphasis>To set the communications mode by + configuring the kernel:</emphasis></para> + + <procedure> - <listitem> + <step> <para>Edit your kernel configuration file. Look for or add an <literal>lpt0</literal> entry. If you are setting up the second parallel port, use <literal>lpt1</literal> instead. Use <literal>lpt2</literal> for the third port, and so @@ -7041,6 +7041,7 @@ sio2: type 16550A</screen> <listitem> <para>If you want interrupt-driven mode, add the <literal>irq</literal> specifier: + <programlisting> device lpt0 at isa? port? tty irq <replaceable>N</replaceable> vector lptintr </programlisting> where <replaceable>N</replaceable> is the IRQ number for your @@ -7050,6 +7051,7 @@ device lpt0 at isa? port? tty irq <replaceable>N</replaceable> vector lptintr <listitem> <para>If you want polled mode, do not add the <literal>irq</literal> specifier: + <programlisting> device lpt0 at isa? port? tty vector lptintr </programlisting></para> @@ -7057,39 +7059,43 @@ device lpt0 at isa? port? tty vector lptintr </itemizedlist> </para> - </listitem> + </step> - <listitem> + <step> <para>Save the file. Then configure, build, and install the kernel, then reboot. See <xref linkend="kernelconfig" remap="kernel configuration"> for more details.</para> - </listitem> + </step> - </orderedlist> - </para> + </procedure> - <para><emphasis remap=bf>To set the communications mode + <para><emphasis>To set the communications mode with</emphasis> <citerefentry> - <refentrytitle>lptcontrol</refentrytitle></citerefentry>: - <itemizedlist> + <refentrytitle>lptcontrol</refentrytitle></citerefentry>:</para> + + <procedure> - <listitem> + <step> <para>Type + <informalexample> <screen>&prompt.root; <userinput>lptcontrol -i -u <replaceable>N</replaceable></userinput></screen> </informalexample> to set interrupt-driven mode for <literal>lpt<replaceable>N</replaceable></literal>.</para> - </listitem> + </step> - <listitem> + <step> <para>Type + <informalexample> <screen>&prompt.root; <userinput>lptcontrol -p -u <replaceable>N</replaceable></userinput></screen> </informalexample> to set polled-mode for <literal>lpt<replaceable>N</replaceable></literal>.</para> - </listitem> + </step> - </itemizedlist> You could put these commands in your + </procedure> + + <para>You could put these commands in your <filename>/etc/rc.local</filename> file to set the mode each time your system boots. See <citerefentry><refentrytitle>lptcontrol</refentrytitle><manvolnum>8</manvolnum></citerefentry> for more information.</para> @@ -7140,16 +7146,17 @@ showpage communicate with a printer connected to a parallel port.</para> - <para><emphasis remap=bf>To test a printer on a parallel - port:</emphasis> - <orderedlist> + <para><emphasis>To test a printer on a parallel + port:</emphasis></para> + + <procedure> - <listitem> + <step> <para>Become root with <citerefentry> <refentrytitle>su</refentrytitle></citerefentry>.</para> - </listitem> + </step> - <listitem> + <step> <para>Send data to the printer. <itemizedlist> @@ -7157,6 +7164,7 @@ showpage <para>If the printer can print plain text, then use <citerefentry> <refentrytitle>lptest</refentrytitle></citerefentry>. Type: + <informalexample> <screen>&prompt.root; <userinput>lptest > /dev/lpt<replaceable>N</replaceable></userinput></screen> </informalexample> where <replaceable>N</replaceable> is the number of the @@ -7167,6 +7175,7 @@ showpage <para>If the printer understands PostScript or other printer language, then send a small program to the printer. Type + <informalexample> <screen>&prompt.root; <userinput>cat > /dev/lpt<replaceable>N</replaceable></userinput></screen> </informalexample> Then, line by line, type the @@ -7178,6 +7187,7 @@ showpage <para>Alternatively, you can put the program in a file and type + <informalexample> <screen>&prompt.root; <userinput>cat <replaceable>file</replaceable> > /dev/lpt<replaceable>N</replaceable></userinput></screen> </informalexample> where <replaceable>file</replaceable> is the name of the @@ -7187,10 +7197,9 @@ showpage </itemizedlist> </para> - </listitem> + </step> - </orderedlist> - </para> + </procedure> <para>You should see something print. Do not worry if the text does not look right; we will fix such things @@ -7205,18 +7214,20 @@ showpage <para>This section tells you how to check if FreeBSD can communicate with a printer on a serial port.</para> - <para><emphasis remap=bf>To test a printer on a serial - port:</emphasis> - <orderedlist> + <para><emphasis>To test a printer on a serial + port:</emphasis></para> + + <procedure> - <listitem> + <step> <para>Become root with <citerefentry> <refentrytitle>su</refentrytitle></citerefentry>.</para> - </listitem> + </step> - <listitem> + <step> <para>Edit the file <filename>/etc/remote</filename>. Add the following entry: + <programlisting> printer:dv=/dev/<replaceable>port</replaceable>:br#<replaceable>bps-rate</replaceable>:pa=<replaceable>parity</replaceable> </programlisting> where <replaceable>port</replaceable> is the device entry for the @@ -7229,12 +7240,13 @@ printer:dv=/dev/<replaceable>port</replaceable>:br#<replaceable>bps-rate</replac <para>Here is a sample entry for a printer connected via a serial line to the third serial port at 19200 bps with no parity: + <programlisting> printer:dv=/dev/ttyd2:br#19200:pa=none </programlisting></para> - </listitem> + </step> - <listitem> + <step> <para>Connect to the printer with <citerefentry> <refentrytitle>tip</refentrytitle></citerefentry>. Type: <informalexample> @@ -7243,9 +7255,9 @@ printer:dv=/dev/ttyd2:br#19200:pa=none the file <filename>/etc/remote</filename> again and try using <filename>/dev/cuaa<replaceable>N</replaceable></filename> instead of <filename>/dev/ttyd<replaceable>N</replaceable></filename>.</para> - </listitem> + </step> - <listitem> + <step> <para>Send data to the printer. <itemizedlist> @@ -7253,6 +7265,7 @@ printer:dv=/dev/ttyd2:br#19200:pa=none <para>If the printer can print plain text, then use <citerefentry> <refentrytitle>lptest</refentrytitle></citerefentry>. Type: + <informalexample> <screen><prompt>~</prompt><userinput>$lptest</userinput></screen> </informalexample></para> @@ -7271,6 +7284,7 @@ printer:dv=/dev/ttyd2:br#19200:pa=none <para>Alternatively, you can put the program in a file and type + <informalexample> <screen><prompt>~</prompt><userinput>><replaceable>file</replaceable></userinput></screen> </informalexample> where <replaceable>file</replaceable> is the name of the @@ -7281,10 +7295,9 @@ printer:dv=/dev/ttyd2:br#19200:pa=none </itemizedlist> </para> - </listitem> + </step> - </orderedlist> - </para> + </procedure> <para>You should see something print. Do not worry if the text does not look right; we will fix that later.</para> @@ -7314,63 +7327,61 @@ printer:dv=/dev/ttyd2:br#19200:pa=none <refentrytitle>printcap</refentrytitle></citerefentry> file is straightforward. Use your favorite text editor to make changes to <filename>/etc/printcap</filename>. The format is identical to other capability files like <filename>/usr/share/misc/termcap</filename> and <filename>/etc/remote</filename>. For complete information about the format, see the <citerefentry><refentrytitle>cgetent</refentrytitle><manvolnum>3</manvolnum></citerefentry>.</para> <para>The simple spooler configuration consists of the following - steps: - <orderedlist> + steps:</para> + + <procedure> - <listitem> + <step> <para>Pick a name (and a few convenient aliases) for the printer, and put them in the <filename>/etc/printcap</filename> file; see <xref linkend="printing-naming" remap="Naming the Printer">.</para> - </listitem> + </step> - <listitem> + <step> <para>Turn off header pages (which are on by default) by - inserting the <emphasis remap=tt>sh</emphasis> capability; + inserting the <literal>sh</literal> capability; see <xref linkend="printing-no-header-pages" remap="Suppressing Header Pages">.</para> - </listitem> + </step> - <listitem> + <step> <para>Make a spooling directory, and specify its location - with the <emphasis remap=tt>sd</emphasis> capability; see + with the <literal>sd</literal> capability; see <xref linkend="printing-spooldir" remap="Making the Spooling Directory">.</para> - </listitem> + </step> - <listitem> + <step> <para>Set the <filename>/dev</filename> entry to use for the printer, and note it in <filename>/etc/printcap</filename> - with the <emphasis remap=tt>lp</emphasis> capability; see + with the <literal>lp</literal> capability; see <xref linkend="printing-device" remap="Identifying the Printer Device">. Also, if the printer is on a serial port, set - up the communication parameters with the <emphasis - remap=tt>fs</emphasis>, <emphasis - remap=tt>fc</emphasis>, <emphasis - remap=tt>xs</emphasis>, and <emphasis - remap=tt>xc</emphasis> capabilities; see <xref + up the communication parameters with the + <literal>fs</literal>, <literal>fc</literal>, + <literal>xs</literal>, and <literal>xc</literal> capabilities; see <xref linkend="printing-commparam" remap="Configuring Spooler Communications Parameters">.</para> - </listitem> + </step> - <listitem> + <step> <para>Install a plain text input filter; see <xref linkend="printing-textfilter" remap="Installing the Text Filter"></para> - </listitem> + </step> - <listitem> + <step> <para>Test the setup by printing something with the <citerefentry> <refentrytitle>lpr</refentrytitle></citerefentry> command; see <xref linkend="printing-trying" remap="Trying It Out"> and <xref linkend="printing-troubleshooting" remap="Troubleshooting">.</para> - </listitem> + </step> - </orderedlist> - </para> + </procedure> <note> <para>Language-based printers, such as PostScript printers, @@ -7435,18 +7446,15 @@ rattan|line|diablo|lp|Diablo 630 Line Printer: bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4: </programlisting> In this example, the first printer is named - <hostid>rattan</hostid> and has as aliases - <emphasis remap=tt>line</emphasis>, <emphasis - remap=tt>diablo</emphasis>, <emphasis - remap=tt>lp</emphasis>, and <emphasis remap=tt>Diablo 630 - Line Printer</emphasis>. Since it has the alias <emphasis - remap=tt>lp</emphasis>, it is also the default printer. The - second is named <hostid>bamboo</hostid>, and has - as aliases <emphasis remap=tt>ps</emphasis>, - <option>PS</option>, <emphasis remap=tt>S</emphasis>, - <emphasis remap=tt>panasonic</emphasis>, and <emphasis - remap=tt>Panasonic KX-P4455 PostScript - v51.4</emphasis>.</para> + <literal>rattan</literal> and has as aliases + <literal>line</literal>, <literal>diablo</literal>, + <literal>lp</literal>, and <literal>Diablo 630 + Line Printer</literal>. Since it has the alias <literal>lp</literal>, it is also the default printer. The + second is named <literal>bamboo</literal>, and has + as aliases <literal>ps</literal>, + <literal>PS</literal>, <literal>S</literal>, + <literal>panasonic</literal>, and <literal>Panasonic KX-P4455 PostScript + v51.4</literal>.</para> </sect4> @@ -7462,11 +7470,9 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4: way of debugging the simple printer setup, so we will suppress header pages.</para> - <para>To suppress header pages, add the <emphasis - remap=tt>sh</emphasis> capability to the entry for the + <para>To suppress header pages, add the <literal>sh</literal> capability to the entry for the printer in <filename>/etc/printcap</filename>. Here is the - example <filename>/etc/printcap</filename> with <emphasis - remap=tt>sh</emphasis> added: + example <filename>/etc/printcap</filename> with <literal>sh</literal> added:</para> <programlisting> # @@ -7478,7 +7484,8 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh: </programlisting> - Note how we used the correct format: the + + <para>Note how we used the correct format: the first line starts in the leftmost column, and subsequent lines are indented with a single TAB. Every line in an entry except the last ends in a backslash character.</para> @@ -7503,13 +7510,15 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ <para>It is also customary to make the directory with a name that is identical to the name of the printer, as shown below: + <informalexample> <screen>&prompt.root; <userinput>mkdir /var/spool/<replaceable>printer-name</replaceable></userinput></screen> </informalexample> However, if you have a lot of printers on your network, you might want to put the spooling directories under a single directory that you reserve just for printing with LPD. We will do this for our two example printers - <hostid>rattan</hostid> and <hostid>bamboo</hostid>: + <literal>rattan</literal> and <literal>bamboo</literal>: + <informalexample> <screen>&prompt.root; <userinput>mkdir /var/spool/lpd</userinput> &prompt.root; <userinput>mkdir /var/spool/lpd/rattan</userinput> @@ -7524,19 +7533,19 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ searchable by user daemon and group daemon, and no one else. We will do this for our example printers:</para> - <para> + <informalexample> <screen>&prompt.root; <userinput>chown daemon.daemon /var/spool/lpd/rattan</userinput> &prompt.root; <userinput>chown daemon.daemon /var/spool/lpd/bamboo</userinput> &prompt.root; <userinput>chmod 770 /var/spool/lpd/rattan</userinput> &prompt.root; <userinput>chmod 770 /var/spool/lpd/bamboo</userinput></screen> - </informalexample></para> + </informalexample> </note> <para>Finally, you need to tell LPD about these directories using the <filename>/etc/printcap</filename> file. You specify the pathname of the spooling directory with the - <emphasis remap=tt>sd</emphasis> capability: + <literal remap="tt">sd</literal> capability:</para> <programlisting> # @@ -7548,13 +7557,13 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo: </programlisting> - Note that the name of the printer starts in + + <para>Note that the name of the printer starts in the first column but all other entries describing the printer should be indented with a tab and each line escaped with a backslash.</para> - <para>If you do not specify a spooling directory with <emphasis - remap=tt>sd</emphasis>, the spooling system will use + <para>If you do not specify a spooling directory with <literal>sd</literal>, the spooling system will use <filename>/var/spool/lpd</filename> as a default.</para> </sect4> @@ -7573,13 +7582,12 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ printer).</para> <para>List the <filename>/dev</filename> entry pathname in the - <filename>/etc/printcap</filename> file using the <emphasis - remap=tt>lp</emphasis> capability.</para> + <filename>/etc/printcap</filename> file using the <literal>lp</literal> capability.</para> <para>In our running example, let us assume that <hostid>rattan</hostid> is on the first parallel port, and <hostid>bamboo</hostid> is on a sixth serial port; here are the additions to - <filename>/etc/printcap</filename>: + <filename>/etc/printcap</filename>:</para> <programlisting> # @@ -7592,7 +7600,7 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ :lp=/dev/ttyd5: - </programlisting></para> + </programlisting> <para>If you do not specify the <emphasis remap=tt>lp</emphasis> capability for a printer in your @@ -7617,6 +7625,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ rate, parity, and other serial communication parameters on behalf of the filter program that sends data to the printer. This is advantageous since + <itemizedlist> <listitem> @@ -7638,70 +7647,62 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ capabilities control serial communication parameters of the device listed in the <emphasis remap=tt>lp</emphasis> capability: + <variablelist> - <varlistentry><term><emphasis - remap=tt>br#<replaceable>bps-rate</replaceable></emphasis></term> + <varlistentry><term><literal>br#<replaceable>bps-rate</replaceable></literal></term> <listitem> <para>Sets the communications speed of the device to - <emphasis remap=it>bps-rate</emphasis>, where - <emphasis remap=it>bps-rate</emphasis> can be 50, 75, + <replaceable>bps-rate</replaceable>, where + <replaceable>bps-rate</replaceable> can be 50, 75, 110, 134, 150, 200, 300, 600, 1200, 1800, 2400, 4800, 9600, 19200, or 38400 bits-per-second.</para> </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt>fc#<replaceable>clear-bits</replaceable></emphasis></term> + <varlistentry><term><literal>fc#<replaceable>clear-bits</replaceable></literal></term> <listitem> - <para>Clears the flag bits <emphasis - remap=it>clear-bits</emphasis> in the <emphasis - remap=tt>sgttyb</emphasis> structure after opening + <para>Clears the flag bits + <replaceable>clear-bits</replaceable> in the + <replaceable>sgttyb</replaceable> structure after opening the device.</para> </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt>fs#<replaceable>set-bits</replaceable></emphasis></term> + <varlistentry><term><literal>fs#<replaceable>set-bits</replaceable></literal></term> <listitem> - <para>Sets the flag bits <emphasis - remap=it>set-bits</emphasis> in the <emphasis - remap=tt>sgttyb</emphasis> structure.</para> + <para>Sets the flag bits + <replaceable>set-bits</replaceable> in the + <replaceable>sgttyb</replaceable> structure.</para> </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt>xc#<replaceable>clear-bits</replaceable></emphasis></term> + <varlistentry><term><literal>xc#<replaceable>clear-bits</replaceable></literal></term> <listitem> - <para>Clears local mode bits <emphasis - remap=it>clear-bits</emphasis> after opening the + <para>Clears local mode bits <replaceable>clear-bits</replaceable> after opening the device.</para> </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt>xs#<replaceable>set-bits</replaceable></emphasis></term> + <varlistentry><term><literal>xs#<replaceable>set-bits</replaceable></literal></term> <listitem> - <para>Sets local mode bits <emphasis - remap=it>set-bits</emphasis>.</para> + <para>Sets local mode bits <replaceable>set-bits</replaceable>.</para> </listitem> </varlistentry> </variablelist> For more information on the bits for the - <emphasis remap=tt>fc</emphasis>, <emphasis - remap=tt>fs</emphasis>, <emphasis remap=tt>xc</emphasis>, - and <emphasis remap=tt>xs</emphasis> capabilities, see the + <literal>fc</literal>, <literal>fs</literal>, <literal>xc</literal>, + and <literal>xs</literal> capabilities, see the file <filename>/usr/include/sys/ioctl_compat.h</filename>.</para> - <para>When LPD opens the device specified by the <emphasis - remap=tt>lp</emphasis> capability, it reads the flag bits in + <para>When LPD opens the device specified by the <literal>lp</literal> capability, it reads the flag bits in the <literal>sgttyb</literal> structure; it clears - any bits in the <emphasis remap=tt>fc</emphasis> capability, - then sets bits in the <emphasis remap=tt>fs</emphasis> + any bits in the <literal remap="tt">fc</literal> capability, + then sets bits in the <literal>fs</literal> capability, then applies the resultant setting. It does the same for the local mode bits as well.</para> @@ -7729,8 +7730,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ program that LPD runs when it has a job to print. When LPD runs the text filter for a printer, it sets the filter's standard input to the job to print, and its standard output to - the printer device specified with the <emphasis - remap=tt>lp</emphasis> capability. The filter is expected + the printer device specified with the <literal>lp</literal> capability. The filter is expected to read the job from standard input, perform any necessary translation for the printer, and write the results to standard output, which will get printed. For more information on the @@ -7740,9 +7740,8 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ <para>For our simple printer setup, the text filter can be a small shell script that just executes - <filename>/bin/cat</filename> to send the job to the printer. - FreeBSD comes with another filter called <emphasis - remap=tt>lpf</emphasis> that handles backspacing and + <command>/bin/cat</command> to send the job to the printer. + FreeBSD comes with another filter called <filename>lpf</filename> that handles backspacing and underlining for printers that might not deal with such character streams well. And, of course, you can use any other filter program you want. The filter <command>lpf</command> is described in detail in section @@ -7766,15 +7765,16 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ exit 2 </programlisting> Make the file executable: + <informalexample> <screen>&prompt.root; <userinput>chmod 555 /usr/local/libexec/if-simple</userinput></screen> </informalexample></para> <para>And then tell LPD to use it by specifying it with the - <emphasis remap=tt>if</emphasis> capability in + <literal>if</literal> capability in <filename>/etc/printcap</filename>. We will add it to the two printers we have so far in the example - <filename>/etc/printcap</filename>: + <filename>/etc/printcap</filename>:</para> <programlisting> # @@ -7788,7 +7788,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:\ :lp=/dev/ttyd5:fs#0x82000e1:xs#0x820:\ :if=/usr/local/libexec/if-simple: - </programlisting></para> + </programlisting> </sect4> @@ -7811,10 +7811,11 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ remap="Checking Printer Communications"> to generate some test text.</para> - <para><emphasis remap=bf>To test the simple LPD + <para><emphasis>To test the simple LPD setup:</emphasis></para> <para>Type: + <informalexample> <screen>&prompt.root; <userinput>lptest 20 5 | lpr -P<replaceable>printer-name</replaceable></userinput></screen> </informalexample> where <emphasis @@ -7825,7 +7826,8 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ without any <option>-P</option> argument. Again, if you are testing a printer that expects PostScript, send a PostScript program in that language instead of using <citerefentry> - <refentrytitle>lptest</refentrytitle></citerefentry>. You can do so by putting the program in a file and typing <emphasis remap=tt>lpr <replaceable>file</replaceable></emphasis>.</para> + <refentrytitle>lptest</refentrytitle></citerefentry>. You + can do so by putting the program in a file and typing <command>lpr <replaceable>file</replaceable></command>.</para> <para>For a PostScript printer, you should get the results of the program. If you are using <citerefentry> @@ -7856,7 +7858,10 @@ $%&'()*+,-./01234567 <title>Troubleshooting</title> <para>After performing the simple test with <citerefentry> - <refentrytitle>lptest</refentrytitle></citerefentry>, you might have gotten one of the following results instead of the correct printout: + <refentrytitle>lptest</refentrytitle></citerefentry>, you + might have gotten one of the following results instead of the + correct printout:</para> + <variablelist> <varlistentry><term>It worked, after awhile; or, it did not eject a full sheet.</term> @@ -8037,12 +8042,30 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ <!-- Need to rewrite this para --> <para>Use the printer's configuration switches or control panel to enforce the following interpretation - of LF and CR characters: - <informalexample> - <screen>Printer received CR Printer prints - CR Printer received LF Printer prints - CR + LF</screen> - </informalexample></para> + of LF and CR characters:</para> + + <informaltable> + <tgroup cols="2"> + <thead> + <row> + <entry>Printer receives</entry> + <entry>Printer prints</entry> + </row> + </thead> + + <tbody> + <row> + <entry>CR</entry> + <entry>CR</entry> + </row> + + <row> + <entry>LF</entry> + <entry>CR + LF</entry> + </row> + </tbody> + </tgroup> + </informaltable> </listitem> </varlistentry> @@ -8064,14 +8087,12 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ <listitem> <para>If the printer supports XON/XOFF flow control, have FreeBSD use it by specifying the - TANDEM bit in the <emphasis - remap=tt>fs</emphasis> capability.</para> + TANDEM bit in the <literal>fs</literal> capability.</para> </listitem> <listitem> <para>If the printer supports carrier flow - control, specify the MDMBUF bit in the <emphasis - remap=tt>fs</emphasis> capability. Make sure + control, specify the MDMBUF bit in the <literal>fs</literal> capability. Make sure the cable connecting the printer to the computer is correctly wired for carrier flow control.</para> </listitem> @@ -8080,7 +8101,7 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ <para>If the printer does not support any flow control, use some combination of the NLDELAY, TBDELAY, CRDELAY, VTDELAY, and BSDELAY bits in - the <emphasis remap=tt>fs</emphasis> capability + the <literal>fs</literal> capability to add appropriate delays to the stream of data sent to the printer.</para> </listitem> @@ -8098,10 +8119,9 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ <para>This is usually another symptom of incorrect communications parameters with a serial printer. - Double-check the bps rate in the <emphasis - remap=tt>br</emphasis> capability, and the parity - bits in the <emphasis remap=tt>fs</emphasis> and - <emphasis remap=tt>fc</emphasis> capabilities; make + Double-check the bps rate in the <literal>br</literal> capability, and the parity + bits in the <literal>fs</literal> and + <literal>fc</literal> capabilities; make sure the printer is using the same settings as specified in the <filename>/etc/printcap</filename> file.</para> @@ -8113,11 +8133,11 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ <listitem> <para>If nothing happened, the problem is probably within FreeBSD and not the hardware. Add the log file - (<emphasis remap=tt>lf</emphasis>) capability to the + (<literal>lf</literal>) capability to the entry for the printer you are debugging in the <filename>/etc/printcap</filename> file. For example, - here is the entry for <hostid>rattan</hostid>, with the <emphasis - remap=tt>lf</emphasis> capability: + here is the entry for <literal>rattan</literal>, with + the <literal>lf</literal> capability: <programlisting> rattan|line|diablo|lp|Diablo 630 Line Printer:\ @@ -8131,14 +8151,12 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ error messages that might appear. Based on the messages you see, try to correct the problem.</para> - <para>If you do not specify a <emphasis - remap=tt>lf</emphasis> capability, LPD uses + <para>If you do not specify a <literal>lf</literal> capability, LPD uses <filename>/dev/console</filename> as a default.</para> </listitem> </varlistentry> </variablelist> - </para> </sect4> </sect3> @@ -8150,7 +8168,8 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ <title>Using Printers</title> <para>This section tells you how to use printers you have setup with - FreeBSD. Here is an overview of the user-level commands: + FreeBSD. Here is an overview of the user-level commands:</para> + <variablelist> <varlistentry><term><citerefentry> <refentrytitle>lpr</refentrytitle></citerefentry></term> @@ -8175,8 +8194,7 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ </listitem> </varlistentry> </variablelist> - </para> - + <para>There is also an administrative command, <citerefentry> <refentrytitle>lpc</refentrytitle></citerefentry>, described in the section <xref linkend="printing-lpc" @@ -8188,21 +8206,20 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ <refentrytitle>lprm</refentrytitle></citerefentry>, and <citerefentry> <refentrytitle>lpq</refentrytitle></citerefentry> - accept an option <option>-P</option> <emphasis - remap=it>printer-name</emphasis> to specify on which + accept an option <option>-P <replaceable>printer-name</replaceable></option> to specify on which printer/queue to operate, as listed in the <filename>/etc/printcap</filename> file. This enables you to submit, remove, and check on jobs for various printers. If you do not use the <option>-P</option> option, then these commands use the - printer specified in the PRINTER environment variable. Finally, if - you do not have a PRINTER environment variable, these commands + printer specified in the <envar>PRINTER</envar> environment variable. Finally, if + you do not have a <envar>PRINTER</envar> environment variable, these commands default to the printer named <emphasis remap=tt>lp</emphasis>.</para> <para>Hereafter, the terminology <emphasis>default printer</emphasis> - means the printer named in the PRINTER environment variable, or the - printer named <emphasis remap=tt>lp</emphasis> when there is no - PRINTER environment variable.</para> + means the printer named in the <envar>PRINTER</envar> environment variable, or the + printer named <literal>lp</literal> when there is no + <envar>PRINTER</envar> environment variable.</para> <sect2 @@ -8210,6 +8227,7 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ <title>Printing Jobs</title> <para>To print files, type + <informalexample> <screen>&prompt.user; <userinput>lpr <replaceable>filename</replaceable> <replaceable>...</replaceable></userinput></screen> </informalexample> This prints each of the listed files to the @@ -8217,13 +8235,16 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ <refentrytitle>lpr</refentrytitle></citerefentry> reads data to print from standard input. For example, this command prints some important system files: + <informalexample> <screen>&prompt.user; <userinput>lpr /etc/host.conf /etc/hosts.equiv</userinput></screen> </informalexample> To select a specific printer, type + <informalexample> <screen>&prompt.user; <userinput>lpr -P <replaceable>printer-name</replaceable> <replaceable>filename</replaceable> <replaceable>...</replaceable></userinput></screen> </informalexample> This example prints a long listing of the - current directory to the printer named <hostid>rattan</hostid>: + current directory to the printer named <literal>rattan</literal>: + <informalexample> <screen>&prompt.user; <userinput>ls -l | lpr -P rattan</userinput></screen> </informalexample> Because no files were listed for the @@ -8250,7 +8271,7 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ <para>When you print with <citerefentry> <refentrytitle>lpr</refentrytitle></citerefentry>, the data you wish to print is put together in a package called a - <emphasis>print job</emphasis>, which is sent to the LPD spooling + <quote>print job</quote>, which is sent to the LPD spooling system. Each printer has a queue of jobs, and your job waits in that queue along with other jobs from yourself and from other users. The printer prints those jobs in a first-come, first-served @@ -8261,10 +8282,12 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ <refentrytitle>lpq</refentrytitle></citerefentry>. For a specific printer, use the <option>-P</option> option. For example, the command + <informalexample> <screen>&prompt.user; <userinput>lpq -P bamboo</userinput></screen> </informalexample> shows the queue for the printer named <hostid>bamboo</hostid>. Here is an example of the output of the <command>lpq</command> command: + <informalexample> <screen>bamboo is ready and printing Rank Owner Job Files Total Size @@ -8272,8 +8295,8 @@ active kelly 9 /etc/host.conf, /etc/hosts.equiv 88 bytes 2nd kelly 10 (standard input) 1635 bytes 3rd mary 11 ... 78519 bytes</screen> </informalexample> This shows three jobs in the queue for - <hostid>bamboo</hostid>. The first job, submitted by - user kelly, got assigned <emphasis>job number</emphasis> 9. Every + <literal>bamboo</literal>. The first job, submitted by + user kelly, got assigned <quote>job number</quote> 9. Every job for a printer gets a unique job number. Most of the time you can ignore the job number, but you will need it if you want to cancel the job; see section @@ -8305,7 +8328,8 @@ active kelly 9 /etc/host.conf, /etc/hosts.equiv 88 bytes <para>The <citerefentry> <refentrytitle>lpq</refentrytitle></citerefentry> command also support a <option>-l</option> option to generate a detailed - long listing. Here is an example of <command>lpq -l</command>: + long listing. Here is an example of <command>lpq -l</command>:</para> + <informalexample> <screen>waiting for bamboo to become ready (offline ?) kelly: 1st [job 009rose] @@ -8317,7 +8341,7 @@ kelly: 2nd [job 010rose] mary: 3rd [job 011rose] /home/orchid/mary/research/venus/alpha-regio/mapping 78519 bytes</screen> - </informalexample></para> + </informalexample> </sect2> @@ -8339,14 +8363,21 @@ mary: 3rd [job 011rose] the job number. Then type <informalexample> <screen>&prompt.user; <userinput>lprm <replaceable>job-number</replaceable></userinput></screen> - </informalexample> To remove the job from a specific printer, add + </informalexample></para> + + <para>To remove the job from a specific printer, add the <option>-P</option> option. The following command removes job - number 10 from the queue for the printer <hostid>bamboo</hostid>: + number 10 from the queue for the printer + <hostid>bamboo</hostid>:</para> + <informalexample> <screen>&prompt.user; <userinput>lprm -P bamboo 10</userinput></screen> - </informalexample> The <citerefentry> + </informalexample> + + <para>The <citerefentry> <refentrytitle>lprm</refentrytitle></citerefentry> - command has a few shortcuts: + command has a few shortcuts:</para> + <variablelist> <varlistentry><term>lprm -</term> <listitem> @@ -8355,12 +8386,11 @@ mary: 3rd [job 011rose] </listitem> </varlistentry> - <varlistentry><term>lprm <emphasis - remap=it>user</emphasis></term> + <varlistentry><term>lprm <replaceable>user</replaceable></term> <listitem> <para>Removes all jobs (for the default printer) belonging - to <emphasis remap=it>user</emphasis>. The superuser can + to <replaceable>user</replaceable>. The superuser can remove other users' jobs; you can remove only your own jobs.</para> </listitem> @@ -8377,12 +8407,11 @@ mary: 3rd [job 011rose] </listitem> </varlistentry> </variablelist> - </para> <para>Just use the <option>-P</option> option with the above shortcuts to operate on a specific printer instead of the default. For example, the following command removes all jobs for the - current user in the queue for the printer named <hostid>rattan</hostid>:</para> + current user in the queue for the printer named <literal>rattan</literal>:</para> <informalexample> <screen>&prompt.user; <userinput>lprm -P rattan -</userinput></screen> @@ -8390,13 +8419,12 @@ mary: 3rd [job 011rose] <note> <para>If you are working in a networked - environment,</para> - - <para><citerefentry> + environment, <citerefentry> <refentrytitle>lprm</refentrytitle></citerefentry> will let you remove jobs only from the host from which the jobs were submitted, even if the same printer is available from other - hosts. The following command sequence demonstrates this: + hosts. The following command sequence demonstrates this:</para> + <informalexample> <screen>&prompt.user; <userinput>lpr -P rattan myfile</userinput> &prompt.user; <userinput>rlogin orchid</userinput> @@ -8411,7 +8439,7 @@ rose: Permission denied dfA013rose dequeued cfA013rose dequeued </screen> - </informalexample></para> + </informalexample> </note> </sect2> @@ -8442,10 +8470,12 @@ cfA013rose dequeued <para>For example, the following command prints a DVI file (from the TeX typesetting system) named <filename>fish-report.dvi</filename> to the printer named - <hostid>bamboo</hostid>: + <literal>bamboo</literal>:</para> <informalexample> <screen>&prompt.user; <userinput>lpr -P bamboo -d fish-report.dvi</userinput></screen> - </informalexample> These options apply to every file in the job, + </informalexample> + + <para>These options apply to every file in the job, so you cannot mix (say) DVI and ditroff files together in a job. Instead, submit the files as separate jobs, using a different conversion option for each job.</para> @@ -8459,7 +8489,7 @@ cfA013rose dequeued Filters"> gives details.</para> </note> - <para> + <variablelist> <varlistentry><term><option>-c</option></term> <listitem> @@ -8492,9 +8522,8 @@ cfA013rose dequeued <replaceable>number</replaceable></option></term> <listitem> - <para>Indent the output by <emphasis - remap=it>number</emphasis> columns; if you omit - <emphasis remap=it>number</emphasis>, indent by 8 + <para>Indent the output by <replaceable>number</replaceable> columns; if you omit + <replaceable>number</replaceable>, indent by 8 columns. This option works only with certain conversion filters.</para> @@ -8534,7 +8563,7 @@ cfA013rose dequeued <replaceable>title</replaceable></option></term> <listitem> - <para>Use <emphasis remap=it>title</emphasis> on the + <para>Use <replaceable>title</replaceable> on the <citerefentry> <refentrytitle>pr</refentrytitle></citerefentry> header instead of the file name. This option has effect @@ -8557,15 +8586,18 @@ cfA013rose dequeued </listitem> </varlistentry> </variablelist> - </para> + <para>Here is an example: this command prints a nicely formatted version of the <citerefentry> <refentrytitle>ls</refentrytitle></citerefentry> manual - page on the default printer: + page on the default printer:</para> + <informalexample> <screen>&prompt.user; <userinput>zcat /usr/share/man/man1/ls.1.gz | troff -t -man | lpr -t</userinput></screen> - </informalexample> The <citerefentry> + </informalexample> + + <para>The <citerefentry> <refentrytitle>zcat</refentrytitle></citerefentry> command uncompresses the source of the</para> @@ -8596,11 +8628,9 @@ cfA013rose dequeued <para> <variablelist> - <varlistentry><term>-# <emphasis - remap=it>copies</emphasis></term> + <varlistentry><term>-# <replaceable>copies</replaceable></term> <listitem> - <para>Produce a number of <emphasis - remap=it>copies</emphasis> of each file in the job + <para>Produce a number of <replaceable>copies</replaceable> of each file in the job instead of just one copy. An administrator may disable this option to reduce printer wear-and-tear and encourage photocopier usage. See section <xref @@ -8609,10 +8639,12 @@ cfA013rose dequeued <para>This example prints three copies of <filename>parser.c</filename> followed by three copies - of <filename>parser.h</filename> to the default printer: + of <filename>parser.h</filename> to the default + printer:</para> + <informalexample> <screen>&prompt.user; <userinput>lpr -#3 parser.c parser.h</userinput></screen> - </informalexample></para> + </informalexample> </listitem> </varlistentry> @@ -8682,24 +8714,22 @@ cfA013rose dequeued linkend="printing-advanced-header-pages" remap="Header Pages"> for information about setting up header pages.</para> - <para> + <variablelist> - <varlistentry><term>-C <emphasis - remap=it>text</emphasis></term> + <varlistentry><term>-C <replaceable>text</replaceable></term> <listitem> <para>Replace the hostname on the header page with - <emphasis remap=it>text</emphasis>. The hostname is + <replaceable>text</replaceable>. The hostname is normally the name of the host from which the job was submitted.</para> </listitem> </varlistentry> - <varlistentry><term>-J <emphasis - remap=it>text</emphasis></term> + <varlistentry><term>-J <replaceable>text</replaceable></term> <listitem> <para>Replace the job name on the header page with - <emphasis remap=it>text</emphasis>. The job name is + <replaceable>text</replaceable>. The job name is normally the name of the first file of the job, or <filename>stdin</filename> if you are printing standard input.</para> </listitem> @@ -8719,7 +8749,7 @@ cfA013rose dequeued </listitem> </varlistentry> </variablelist> - </para> + </sect3> </sect2> @@ -8779,24 +8809,23 @@ cfA013rose dequeued <para>Here is a summary of the <citerefentry> <refentrytitle>lpc</refentrytitle></citerefentry> - commands. Most of the commands takes a <emphasis - remap=it>printer-name</emphasis> argument to tell on which + commands. Most of the commands takes a <replaceable>printer-name</replaceable> argument to tell on which printer to operate. You can use <literal>all</literal> - for the <emphasis remap=it>printer-name</emphasis> to mean all + for the <replaceable>printer-name</replaceable> to mean all printers listed in <filename>/etc/printcap</filename>.</para> - <para> + <variablelist> - <varlistentry><term><emphasis remap=tt>abort - <replaceable>printer-name</replaceable></emphasis></term> + <varlistentry><term><command>abort + <replaceable>printer-name</replaceable></command></term> <listitem> <para>Cancel the current job and stop the printer. Users can still submit jobs if the queue's enabled.</para> </listitem> </varlistentry> - <varlistentry><term><emphasis remap=tt>clean - <replaceable>printer-name</replaceable></emphasis></term> + <varlistentry><term><command>clean + <replaceable>printer-name</replaceable></command></term> <listitem> <para>Remove old files from the printer's spooling @@ -8808,8 +8837,8 @@ cfA013rose dequeued </listitem> </varlistentry> - <varlistentry><term><emphasis remap=tt>disable - <replaceable>printer-name</replaceable></emphasis></term> + <varlistentry><term><command>disable + <replaceable>printer-name</replaceable></command></term> <listitem> <para>Disable queuing of new jobs. If the printer's @@ -8821,18 +8850,19 @@ cfA013rose dequeued printer or filter installation: disable the queue and submit jobs as root. Other users will not be able to submit jobs until you complete your testing and re-enable - the queue with the <emphasis remap=tt>enable</emphasis> + the queue with the <command>enable</command> command.</para> </listitem> </varlistentry> - <varlistentry><term><emphasis remap=tt>down + <varlistentry><term><command remap="tt">down <replaceable>printer-name</replaceable> - <replaceable>message...</replaceable></emphasis></term> + <replaceable>message</replaceable></command></term> <listitem> - <para>Take a printer down. Equivalent to <command>disable</command> followed by <command>stop</command>. The <emphasis - remap=it>message</emphasis> appears as the printer's + <para>Take a printer down. Equivalent to + <command>disable</command> followed by + <command>stop</command>. The <replaceable>message</replaceable> appears as the printer's status whenever a user checks the printer's queue with <citerefentry> <refentrytitle>lpq</refentrytitle></citerefentry> @@ -8841,8 +8871,8 @@ cfA013rose dequeued </listitem> </varlistentry> - <varlistentry><term><emphasis remap=tt>enable - <replaceable>printer-name</replaceable></emphasis></term> + <varlistentry><term><command>enable + <replaceable>printer-name</replaceable></command></term> <listitem> <para>Enable the queue for a printer. Users can submit jobs @@ -8851,19 +8881,19 @@ cfA013rose dequeued </listitem> </varlistentry> - <varlistentry><term><emphasis remap=tt>help - <replaceable>command-name</replaceable></emphasis></term> + <varlistentry><term><command remap="tt">help + <replaceable>command-name</replaceable></command></term> <listitem> - <para>Print help on the command <emphasis - remap=it>command-name</emphasis>. With no <emphasis - remap=it>command-name</emphasis>, print a summary of the + <para>Print help on the command + <replaceable>command-name</replaceable>. With no + <replaceable>command-name</replaceable>, print a summary of the commands available.</para> </listitem> </varlistentry> - <varlistentry><term><emphasis remap=tt>restart - <replaceable>printer-name</replaceable></emphasis></term> + <varlistentry><term><command>restart + <replaceable>printer-name</replaceable></command></term> <listitem> <para>Start the printer. Ordinary users can use this @@ -8875,8 +8905,8 @@ cfA013rose dequeued </listitem> </varlistentry> - <varlistentry><term><emphasis remap=tt>start - <replaceable>printer-name</replaceable></emphasis></term> + <varlistentry><term><command>start + <replaceable>printer-name</replaceable></command></term> <listitem> <para>Start the printer. The printer will print jobs in its @@ -8884,8 +8914,8 @@ cfA013rose dequeued </listitem> </varlistentry> - <varlistentry><term><emphasis remap=tt>stop - <replaceable>printer-name</replaceable></emphasis></term> + <varlistentry><term><command>stop + <replaceable>printer-name</replaceable></command></term> <listitem> <para>Stop the printer. The printer will finish the current @@ -8895,23 +8925,21 @@ cfA013rose dequeued </listitem> </varlistentry> - <varlistentry><term><emphasis remap=tt>topq + <varlistentry><term><command>topq <replaceable>printer-name</replaceable> - <replaceable>job-or-username...</replaceable></emphasis></term> + <replaceable>job-or-username</replaceable></command></term> <listitem> - <para>Rearrange the queue for <emphasis - remap=it>printer-name</emphasis> by placing the jobs - with the listed <emphasis remap=it>job</emphasis> numbers - or the jobs belonging to <emphasis - remap=it>username</emphasis> at the top of the queue. - For this command, you cannot use <literal>all</literal> as the <emphasis - remap=it>printer-name</emphasis>.</para> + <para>Rearrange the queue for <replaceable>printer-name</replaceable> by placing the jobs + with the listed <replaceable>job</replaceable> numbers + or the jobs belonging to <replaceable>username</replaceable> at the top of the queue. + For this command, you cannot use <literal>all</literal> as + the <replaceable>printer-name</replaceable>.</para> </listitem> </varlistentry> - <varlistentry><term><emphasis remap=tt>up - <replaceable>printer-name</replaceable></emphasis></term> + <varlistentry><term><command>up + <replaceable>printer-name</replaceable></command></term> <listitem> <para>Bring a printer up; the opposite of the <command>down</command> command. Equivalent to @@ -8919,7 +8947,7 @@ cfA013rose dequeued </listitem> </varlistentry> </variablelist> - </para> + <para><citerefentry> <refentrytitle>lpc</refentrytitle></citerefentry> accepts @@ -8973,7 +9001,7 @@ cfA013rose dequeued <para>Here is what you will find in this section:</para> - <para> + <itemizedlist> <listitem> @@ -9045,7 +9073,6 @@ cfA013rose dequeued </listitem> </itemizedlist> - </para> <sect3 @@ -9059,8 +9086,7 @@ cfA013rose dequeued <para>When LPD wants to print a file in a job, it starts a filter program. It sets the filter's standard input to the file to print, its standard output to the printer, and its standard - error to the error logging file (specified in the <emphasis - remap=tt>lf</emphasis> capability in + error to the error logging file (specified in the <literal>lf</literal> capability in <filename>/etc/printcap</filename>, or <filename>/dev/console</filename> by default).</para> @@ -9072,15 +9098,16 @@ cfA013rose dequeued <refentrytitle>lpr</refentrytitle></citerefentry> command line. For example, if the user typed <command>lpr -t</command>, LPD would start the troff filter, listed in the - <emphasis remap=tt>tf</emphasis> capability for the destination + <literal>tf</literal> capability for the destination printer. If the user wanted to print plain text, it would start - the <emphasis remap=tt>if</emphasis> filter (this is mostly + the <literal>if</literal> filter (this is mostly true: see <xref linkend="printing-advanced-of" remap="Output Filters"> for details).</para> <para>There are three kinds of filters you can specify in - <filename>/etc/printcap</filename>: + <filename>/etc/printcap</filename>:</para> + <itemizedlist> <listitem> @@ -9097,6 +9124,7 @@ cfA013rose dequeued and comparing that to the number of lines per page the printer supports. The text filter is started with the following argument list: + <cmdsynopsis> <command>filter-name</command> <arg>-c</arg> @@ -9107,6 +9135,7 @@ cfA013rose dequeued <arg choice="plain">-h <replaceable>host</replaceable></arg> <arg choice="plain"><replaceable>acct-file</replaceable></arg> </cmdsynopsis> where + <variablelist> <varlistentry><term><option>-c</option></term> <listitem> @@ -9115,29 +9144,24 @@ cfA013rose dequeued </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt><replaceable>width</replaceable></emphasis></term> + <varlistentry><term><replaceable>width</replaceable></term> <listitem> - <para>is the value from the <emphasis - remap=tt>pw</emphasis> (page width) capability + <para>is the value from the <literal>pw</literal> (page width) capability specified in <filename>/etc/printcap</filename>, default 132</para> </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt><replaceable>length</replaceable></emphasis></term> + <varlistentry><term><replaceable>length</replaceable></term> <listitem> - <para>is the value from the <emphasis - remap=tt>pl</emphasis> (page length) capability, + <para>is the value from the <literal>pl</literal> (page length) capability, default 66</para> </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt><replaceable>indent</replaceable></emphasis></term> + <varlistentry><term><replaceable>indent</replaceable></term> <listitem> <para>is the amount of the indentation from @@ -9145,8 +9169,7 @@ cfA013rose dequeued </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt><replaceable>login</replaceable></emphasis></term> + <varlistentry><term><replaceable>login</replaceable></term> <listitem> <para>is the account name of the user printing the @@ -9154,8 +9177,7 @@ cfA013rose dequeued </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt><replaceable>host</replaceable></emphasis></term> + <varlistentry><term><replaceable>host</replaceable></term> <listitem> <para>is the host name from which the job was @@ -9163,12 +9185,11 @@ cfA013rose dequeued </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt><replaceable>acct-file</replaceable></emphasis></term> + <varlistentry><term><replaceable>acct-file</replaceable></term> <listitem> <para>is the name of the accounting file from the - <emphasis remap=tt>af</emphasis> + <literal>af</literal> capability.</para> </listitem> </varlistentry> @@ -9189,6 +9210,7 @@ cfA013rose dequeued Conversion filters also need to do accounting, if you need printer accounting. Conversion filters are started with the following arguments: + <cmdsynopsis> <command>filter-name</command> <arg @@ -9198,9 +9220,9 @@ cfA013rose dequeued <arg choice="plain">-h <replaceable>host</replaceable></arg> <arg choice="plain"><replaceable>acct-file</replaceable></arg> </cmdsynopsis> where <replaceable>pixel-width</replaceable> is the value from the - <emphasis remap=tt>px</emphasis> capability (default 0) + <literal>px</literal> capability (default 0) and <replaceable>pixel-height</replaceable> is the - value from the <emphasis remap=tt>py</emphasis> capability + value from the <literal>py</literal> capability (default 0).</para> </listitem> @@ -9211,6 +9233,7 @@ cfA013rose dequeued <xref linkend="printing-advanced-of" remap="Output Filters"> describe them. There are only two arguments to an output filter: + <cmdsynopsis> <command>filter-name</command> <arg choice="plain">-w<replaceable>width</replaceable></arg> @@ -9222,10 +9245,10 @@ cfA013rose dequeued </listitem> </itemizedlist> - </para> <para>Filters should also <emphasis>exit</emphasis> with the - following exit status: + following exit status:</para> + <variablelist> <varlistentry><term>exit 0</term> <listitem> @@ -9252,7 +9275,6 @@ cfA013rose dequeued </listitem> </varlistentry> </variablelist> - </para> <para>The text filter that comes with the FreeBSD release, <filename>/usr/libexec/lpr/lpf</filename>, takes advantage of @@ -9314,17 +9336,19 @@ cfA013rose dequeued is part of <command>lprps</command>. If you installed <command>lprps</command> from the ports collection, use the following in the serial PostScript printer's - entry in <filename>/etc/printcap</filename>: + entry in <filename>/etc/printcap</filename>:</para> + <programlisting> :if=/usr/local/libexec/psif: - </programlisting> You should also specify the <emphasis - remap=tt>rw</emphasis> capability; that tells LPD to open the + </programlisting> + + <para>You should also specify the <literal>rw</literal> capability; that tells LPD to open the printer in read-write mode.</para> <para>If you have a parallel PostScript printer (and therefore cannot use two-way communication with the printer, which <command>lprps</command> needs), you can use the - following shell script as the text filter: + following shell script as the text filter:</para> <programlisting> #!/bin/sh @@ -9351,7 +9375,8 @@ else exit 2 fi </programlisting> - In the above script, <command>textps</command> is a program we installed + + <para>In the above script, <command>textps</command> is a program we installed separately to convert plain text to PostScript. You can use any text-to-PostScript program you wish. The FreeBSD ports collection (see <xref linkend="ports" remap="The Ports @@ -9370,7 +9395,7 @@ fi standard for high quality typesetting and printing. PostScript is, however, an <emphasis>expensive</emphasis> standard. Thankfully, Alladin Enterprises has a free PostScript work-alike - called <emphasis remap=it>Ghostscript</emphasis> that runs with + called <application>Ghostscript</application> that runs with FreeBSD. Ghostscript can read most PostScript files and can render their pages onto a variety of devices, including many brands of non-PostScript printers. By installing Ghostscript @@ -9393,13 +9418,13 @@ fi substitute the <option>-sDEVICE</option> argument to the</para> <para><citerefentry> - <refentrytitle>gs</refentrytitle></citerefentry> (Ghostscript) command. (Type <command>gs -h</command> to get a list of devices the current installation of Ghostscript supports.) + <refentrytitle>gs</refentrytitle></citerefentry> (Ghostscript) command. (Type <command>gs -h</command> to get a list of devices the current installation of Ghostscript supports.)</para> <programlisting> #!/bin/sh # # ifhp - Print Ghostscript-simulated PostScript on a DeskJet 500 -# Installed in /usr/local/libexec/hpif +# Installed in /usr/local/libexec/hpif # # Treat LF as CR+LF: @@ -9428,8 +9453,9 @@ fi exit 2 </programlisting> - Finally, you need to notify LPD of the filter - via the <emphasis remap=tt>if</emphasis> capability: + + <para>Finally, you need to notify LPD of the filter + via the <literal remap="tt">if</literal> capability: <programlisting> :if=/usr/local/libexec/hpif: </programlisting> That is it. You can type <command>lpr plain.text</command> and <filename>lpr @@ -9457,17 +9483,23 @@ exit 2 typesetting system, and we have a PostScript printer. Every time we generate a DVI file from TeX, we cannot print it directly until we convert the DVI file into PostScript. The - command sequence goes like this: + command sequence goes like this:</para> + <informalexample> <screen>&prompt.user; <userinput>dvips seaweed-analysis.dvi</userinput> &prompt.user; <userinput>lpr seaweed-analysis.ps</userinput></screen> - </informalexample> By installing a conversion filter for DVI + </informalexample> + + <para>By installing a conversion filter for DVI files, we can skip the hand conversion step each time by having LPD do it for us. Now, each time we get a DVI file, we - are just one step away from printing it: + are just one step away from printing it:</para> + <informalexample> <screen>&prompt.user; <userinput>lpr -d seaweed-analysis.dvi</userinput></screen> - </informalexample> We got LPD to do the DVI file conversion + </informalexample> + + <para>We got LPD to do the DVI file conversion for us by specifying the <option>-d</option> option. Section <xref linkend="printing-lpr-options-format" remap="Formatting and @@ -9496,9 +9528,9 @@ exit 2 <para>The following table summarizes the filters that LPD works with, their capability entries for the <filename>/etc/printcap</filename> file, and how to invoke - them with the <command>lpr</command> command: + them with the <command>lpr</command> command:</para> - <informaltable> + <informaltable frame="none"> <tgroup cols="3"> <thead> <row> @@ -9558,10 +9590,10 @@ exit 2 </row> </tbody> </tgroup> - </informaltable></para> + </informaltable> <para>In our example, using <command>lpr -d</command> means the - printer needs a <emphasis remap=tt>df</emphasis> capability in + printer needs a <literal>df</literal> capability in its entry in <filename>/etc/printcap</filename>.</para> <para>Despite what others might contend, formats like FORTRAN @@ -9571,7 +9603,7 @@ exit 2 would like to directly print Printerleaf files (files from the Interleaf desktop publishing program), but will never print plot files. You could install a Printerleaf conversion filter - under the <emphasis remap=tt>gf</emphasis> capability and then + under the <literal>gf</literal> capability and then educate your users that <command>lpr -g</command> mean <quote>print Printerleaf files.</quote></para> @@ -9592,10 +9624,10 @@ exit 2 <filename>/etc/printcap</filename>.</para> <para>In our example, we will add the DVI conversion filter to - the entry for the printer named <hostid>bamboo</hostid>. Here is the example + the entry for the printer named <literal>bamboo</literal>. Here is the example <filename>/etc/printcap</filename> file again, with the new - <emphasis remap=tt>df</emphasis> capability for the printer - <hostid>bamboo</hostid> + <literal>df</literal> capability for the printer + <literal>bamboo</literal>.</para> <programlisting> # @@ -9612,9 +9644,10 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: </programlisting> - The DVI filter is a shell script named + + <para>The DVI filter is a shell script named <filename>/usr/local/libexec/psdf</filename>. Here is that - script: + script:</para> <programlisting> #!bin/sh @@ -9626,7 +9659,8 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ # exec /usr/local/bin/dvips -f | /usr/local/libexec/lprps "$@" </programlisting> - This script runs <citerefentry> + + <para>This script runs <citerefentry> <refentrytitle>dvips</refentrytitle></citerefentry> in filter mode (the <option>-f</option> argument) on standard input, which is the job to print. It then starts the PostScript printer filter <command>lprps</command> (see section <xref linkend="printing-advanced-if-conversion" remap="Accommodating Plain Text Jobs on PostScript Printers">) with the arguments LPD passed to this script. @@ -9645,7 +9679,7 @@ exec /usr/local/bin/dvips -f | /usr/local/libexec/lprps "$@" <para>This example script is a raster (well, GIF file, actually) conversion filter for a Hewlett Packard LaserJet III-Si - printer: + printer:</para> <programlisting> #!/bin/sh @@ -9657,13 +9691,14 @@ PATH=/usr/X11R6/bin:$PATH; export PATH giftopnm | ppmtopgm | pgmtopbm | pbmtolj && exit 0 \ || exit 2 </programlisting> - It works by converting the GIF file into a + + <para>It works by converting the GIF file into a portable anymap, converting that into a portable graymap, converting that into a portable bitmap, and converting that into LaserJet/PCL-compatible data.</para> <para>Here is the <filename>/etc/printcap</filename> file with - an entry for a printer using the above filter: + an entry for a printer using the above filter:</para> <programlisting> # @@ -9673,11 +9708,11 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ :lp=/dev/lpt0:sh:sd=/var/spool/lpd/teak:mx#0:\ :if=/usr/local/libexec/hpif:\ :vf=/usr/local/libexec/hpvf: - </programlisting></para> + </programlisting> <para>The following script is a conversion filter for troff data from the groff typesetting system for the PostScript printer - named <hostid>bamboo</hostid>: + named <literal>bamboo</literal>:</para> <programlisting> #!/bin/sh @@ -9687,9 +9722,10 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ # exec grops | /usr/local/libexec/lprps "$@" </programlisting> - The above script makes use of <command>lprps</command> again to handle the communication + + <para>The above script makes use of <command>lprps</command> again to handle the communication with the printer. If the printer were on a parallel port, we - would use this script instead: + would use this script instead:</para> <programlisting> #!/bin/sh @@ -9699,17 +9735,19 @@ exec grops | /usr/local/libexec/lprps "$@" # exec grops </programlisting> - That is it. Here is the entry we need to + + <para>That is it. Here is the entry we need to add to <filename>/etc/printcap</filename> to enable the - filter: + filter:</para> + <programlisting> :tf=/usr/local/libexec/pstf: - </programlisting></para> + </programlisting> <para>Here is an example that might make old hands at FORTRAN blush. It is a FORTRAN-text filter for any printer that can directly print plain text. We will install it for the printer - <hostid>teak</hostid>: + <literal>teak</literal>:</para> <programlisting> #!/bin/sh @@ -9721,19 +9759,23 @@ exec grops printf "\033&k2G" && fpr && printf "\f" && exit 0 exit 2 </programlisting> - And we will add this line to the - <filename>/etc/printcap</filename> for the printer <hostid>teak</hostid> to enable this filter: + + <para>And we will add this line to the + <filename>/etc/printcap</filename> for the printer + <literal>teak</literal> to enable this filter:</para> + <programlisting> :rf=/usr/local/libexec/hprf: - </programlisting></para> + </programlisting> <para>Here is one final, somewhat complex example. We will add - a DVI filter to the LaserJet printer <hostid>teak</hostid> introduced earlier. First, the + a DVI filter to the LaserJet printer <literal>teak</literal> introduced earlier. First, the easy part: updating <filename>/etc/printcap</filename> with - the location of the DVI filter: + the location of the DVI filter:</para> + <programlisting> :df=/usr/local/libexec/hpdf: - </programlisting></para> + </programlisting> <para>Now, for the hard part: making the filter. For that, we need a DVI-to-LaserJet/PCL conversion program. The FreeBSD @@ -9761,9 +9803,8 @@ exit 2 <para>The only other fly in the ointment is the fact that we cannot use <filename>/tmp</filename> for the temporary link. - Symbolic links are owned by user and group <emphasis - remap=tt>bin</emphasis>. The filter runs as user <emphasis - remap=tt>daemon</emphasis>. And the + Symbolic links are owned by user and group + <username>bin</username>. The filter runs as user <username>daemon</username>. And the <filename>/tmp</filename> directory has the sticky bit set. The filter can create the link, but it will not be able clean up when done and remove it since the link will belong to a @@ -9771,13 +9812,13 @@ exit 2 <para>Instead, the filter will make the symbolic link in the current working directory, which is the spooling directory - (specified by the <emphasis remap=tt>sd</emphasis> capability + (specified by the <literal>sd</literal> capability in <filename>/etc/printcap</filename>). This is a perfect place for filters to do their work, especially since there is (sometimes) more free disk space in the spooling directory than under <filename>/tmp</filename>.</para> - <para>Here, finally, is the filter: + <para>Here, finally, is the filter:</para> <programlisting> #!/bin/sh @@ -9839,7 +9880,7 @@ dvilj2p -M1 -q -e- dfhp$$.dvi # cleanup exit 0 - </programlisting></para> + </programlisting> </sect4> @@ -9901,13 +9942,14 @@ exit 0 <para>LPD does not pass the user's login or host to the filter, so it is not intended to do accounting. In fact, it gets only two arguments: + <cmdsynopsis> <command>filter-name</command> <arg choice="plain">-w<replaceable>width</replaceable></arg> <arg choice="plain">-l<replaceable>length</replaceable></arg> - </cmdsynopsis> where <replaceable>width</replaceable> is from the <emphasis - remap=tt>pw</emphasis> capability and <replaceable>length</replaceable> is from the <emphasis - remap=tt>pl</emphasis> capability for the printer in + </cmdsynopsis> where <replaceable>width</replaceable> is + from the <literal>pw</literal> capability and + <replaceable>length</replaceable> is from the <literal>pl</literal> capability for the printer in question.</para> </listitem> @@ -9980,8 +10022,7 @@ exit 0 <para>In order for <command>lpf</command> to do page accounting correctly, it needs correct values filled in for the - <emphasis remap=tt>pw</emphasis> and <emphasis - remap=tt>pl</emphasis> capabilities in the + <literal>pw</literal> and <literal>pl</literal> capabilities in the <filename>/etc/printcap</filename> file. It uses these values to determine how much text can fit on a page and how many pages were in a user's job. For more information on printer @@ -10029,15 +10070,14 @@ exit 0 Printer Setup">, we turned off header pages by specifying <literal>sh</literal> (meaning <quote>suppress header</quote>) in the <filename>/etc/printcap</filename> file. To - enable header pages for a printer, just remove the <emphasis - remap=tt>sh</emphasis> capability.</para> + enable header pages for a printer, just remove the <literal>sh</literal> capability.</para> <para>Sounds too easy, right?</para> <para>You are right. You <emphasis>might</emphasis> have to provide an output filter to send initialization strings to the printer. Here is an example output filter for Hewlett Packard - PCL-compatible printers: + PCL-compatible printers:</para> <programlisting> #!/bin/sh @@ -10048,15 +10088,16 @@ exit 0 printf "\033&k2G" || exit 2 exec /usr/libexec/lpr/lpf </programlisting> - Specify the path to the output filter in the - <emphasis remap=tt>of</emphasis> capability. See <xref + + <para>Specify the path to the output filter in the + <literal remap="tt">of</literal> capability. See <xref linkend="printing-advanced-of" remap="Output Filters"> for more information.</para> <para>Here is an example <filename>/etc/printcap</filename> file - for the printer <hostid>teak</hostid> that we + for the printer <literal>teak</literal> that we introduced earlier; we enabled header pages and added the above - output filter: + output filter:</para> <programlisting> # @@ -10068,7 +10109,8 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ :vf=/usr/local/libexec/hpvf:\ :of=/usr/local/libexec/hpof: </programlisting> - Now, when users print jobs to <hostid>teak</hostid>, they get a header page with each + + <para>Now, when users print jobs to <literal>teak</literal>, they get a header page with each job. If users want to spend time searching for their printouts, they can suppress header pages by submitting the job with <command>lpr -h</command>; see <xref @@ -10080,8 +10122,7 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ <note> <para>LPD prints a form feed character after the header page. If your printer uses a different character or sequence of - characters to eject a page, specify them with the <emphasis - remap=tt>ff</emphasis> capability in + characters to eject a page, specify them with the <literal>ff</literal> capability in <filename>/etc/printcap</filename>.</para> </note> @@ -10094,7 +10135,8 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ <para>By enabling header pages, LPD will produce a <emphasis>long header</emphasis>, a full page of large letters identifying the user, host, and job. Here is an example (kelly printed the - job named outline from host rose): + job named outline from host rose):</para> + <programlisting> k ll ll k l l @@ -10143,19 +10185,23 @@ teak|hp|laserjet|Hewlett Packard LaserJet 3Si:\ Job: outline Date: Sun Sep 17 11:04:58 1995 - </programlisting> LPD appends a form feed after this text so - the job starts on a new page (unless you have <emphasis - remap=tt>sf</emphasis> (suppress form feeds) in the + </programlisting> + + <para>LPD appends a form feed after this text so + the job starts on a new page (unless you have <literal>sf</literal> (suppress form feeds) in the destination printer's entry in <filename>/etc/printcap</filename>).</para> <para>If you prefer, LPD can make a <emphasis>short header</emphasis>; specify <literal>sb</literal> (short banner) in the <filename>/etc/printcap</filename> file. - The header page will look like this: + The header page will look like this:</para> + <programlisting> rose:kelly Job: outline Date: Sun Sep 17 11:07:51 1995 - </programlisting> Also by default, LPD prints the header page + </programlisting> + + <para>Also by default, LPD prints the header page first, then the job. To reverse that, specify <literal>hl</literal> (header last) in <filename>/etc/printcap</filename>.</para> @@ -10222,11 +10268,10 @@ rose:kelly Job: outline Date: Sun Sep 17 11:07:51 1995 the header page. The only other problem with this method is that the output filter still does not know what accounting file to use (it is not passed the name of the - file from the <emphasis remap=tt>af</emphasis> + file from the <literal>af</literal> capability), but if you have a well-known accounting file, you can hard-code that into the output filter. To - facilitate the parsing step, use the <emphasis - remap=tt>sh</emphasis> (short header) capability in + facilitate the parsing step, use the <literal>sh</literal> (short header) capability in <filename>/etc/printcap</filename>. Then again, all that might be too much trouble, and users will certainly appreciate the more generous system administrator who @@ -10256,7 +10301,7 @@ rose:kelly Job: outline Date: Sun Sep 17 11:07:51 1995 <para>Let us explore this method. The following script takes three arguments (user login name, host name, and job name) and - makes a simple PostScript header page: + makes a simple PostScript header page:</para> <programlisting> #!/bin/sh @@ -10339,11 +10384,12 @@ restore showpage EOF </programlisting> - Now, each of the conversion filters and the + + <para>Now, each of the conversion filters and the text filter can call this script to first generate the header page, and then print the user's job. Here is the DVI conversion filter from earlier in this document, modified to make a header - page: + page:</para> <programlisting> #!/bin/sh @@ -10378,7 +10424,8 @@ done ( /usr/local/libexec/make-ps-header $login $host "DVI File" /usr/local/bin/dvips -f ) | eval /usr/local/libexec/lprps $orig_args </programlisting> - Notice how the filter has to parse the + + <para>Notice how the filter has to parse the argument list in order to determine the user and host name. The parsing for the other conversion filters is identical. The text filter takes a slightly different set of arguments, though (see @@ -10508,24 +10555,23 @@ done </listitem> <listitem> - <para>Leave the <emphasis remap=tt>lp</emphasis> capability + <para>Leave the <literal>lp</literal> capability blank, explicitly (<literal>:lp=:</literal>).</para> </listitem> <listitem> <para>Make a spooling directory and specify its location in - the <emphasis remap=tt>sd</emphasis> capability. LPD will + the <literal>sd</literal> capability. LPD will store jobs here before they get sent to the printer host.</para> </listitem> <listitem> - <para>Place the name of the printer host in the <emphasis - remap=tt>rm</emphasis> capability.</para> + <para>Place the name of the printer host in the <literal>rm</literal> capability.</para> </listitem> <listitem> <para>Place the printer name on the <emphasis>printer - host</emphasis> in the <emphasis remap=tt>rp</emphasis> + host</emphasis> in the <literal>rp</literal> capability.</para> </listitem> @@ -10533,15 +10579,15 @@ done filters, page dimensions, or anything else in the <filename>/etc/printcap</filename> file.</para> - <para>Here is an example. The host rose has two printers, - <hostid>bamboo</hostid> and <hostid>rattan</hostid>. We will enable users on the host + <para>Here is an example. The host <hostid>rose</hostid> has two printers, + <literal>bamboo</literal> and <literal>rattan</literal>. We will enable users on the host orchid to print to those printers. Here is the - <filename>/etc/printcap</filename> file for orchid (back from + <filename>/etc/printcap</filename> file for <hostid>orchid</hostid> (back from section <xref linkend="printing-advanced-header-pages-enabling" remap="Enabling Header Pages">). It already had the entry for - the printer <hostid>teak</hostid>; we have added - entries for the two printers on the host rose: + the printer <literal>teak</literal>; we have added + entries for the two printers on the host rose:</para> <programlisting> # @@ -10569,17 +10615,20 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :lp=:rm=rose:rp=bamboo:sd=/var/spool/lpd/bamboo: </programlisting> - Then, we just need to make spooling - directories on orchid: + + <para>Then, we just need to make spooling + directories on <hostid>orchid</hostid>:</para> <informalexample> <screen>&prompt.root; <userinput>mkdir -p /var/spool/lpd/rattan /var/spool/lpd/bamboo</userinput> &prompt.root; <userinput>chmod 770 /var/spool/lpd/rattan /var/spool/lpd/bamboo</userinput> &prompt.root; <userinput>chown daemon.daemon /var/spool/lpd/rattan /var/spool/lpd/bamboo</userinput></screen> - </informalexample></para> + </informalexample> - <para>Now, users on orchid can print to <hostid>rattan</hostid> and <hostid>bamboo</hostid>. If, for example, a user on orchid + <para>Now, users on <hostid>orchid</hostid> can print to + <literal>rattan</literal> and <literal>bamboo</literal>. If, for example, a user on orchid typed + <informalexample> <screen>&prompt.user; <userinput>lpr -P bamboo -d sushi-review.dvi</userinput></screen> </informalexample> the LPD system on orchid would copy the job @@ -10625,7 +10674,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ one-way communication only (FreeBSD to printer); many network printers support two-way communication, and you might want to take advantage of that (to get printer status, perform - accounting, etc.). + accounting, etc.).</para> <programlisting> #!/usr/bin/perl @@ -10652,11 +10701,12 @@ connect(PRINTER, $sockaddr) || die "Can't contact $printer_host: $!"; while (<STDIN>) { print PRINTER; } exit 0; </programlisting> - We can then use this script in various + + <para>We can then use this script in various filters. Suppose we had a Diablo 750-N line printer connected to the network. The printer accepts data to print on port number 5100. The host name of the printer is scrivener. Here - is the text filter for the printer: + is the text filter for the printer:</para> <programlisting> #!/bin/sh @@ -10664,7 +10714,7 @@ exit 0; # diablo-if-net - Text filter for Diablo printer `scrivener' listening # on port 5100. Installed in /usr/local/libexec/diablo-if-net # exec /usr/libexec/lpr/lpf "$@" | /usr/local/libexec/netprint scrivener 5100 - </programlisting></para> + </programlisting> </sect3> </sect2> @@ -10693,9 +10743,10 @@ exit 0; on your printers, you can disable the <option>-#</option> option to <citerefentry> <refentrytitle>lpr</refentrytitle></citerefentry> by - adding the <emphasis remap=tt>sc</emphasis> capability to the + adding the <literal>sc</literal> capability to the <filename>/etc/printcap</filename> file. When users submit jobs with the <option>-#</option> option, they will see + <informalexample> <screen>lpr: multiple copies are not allowed</screen> </informalexample></para> @@ -10703,17 +10754,16 @@ exit 0; <para>Note that if you have set up access to a printer remotely (see section <xref linkend="printing-advanced-network-rm" remap="Printers Installed on Remote Hosts">), you need - the <emphasis remap=tt>sc</emphasis> capability on the remote + the <literal>sc</literal> capability on the remote <filename>/etc/printcap</filename> files as well, or else users will still be able to submit multiple-copy jobs by using another host.</para> <para>Here is an example. This is the - <filename>/etc/printcap</filename> file for the host rose. The - printer <hostid>rattan</hostid> is quite hearty, so - we will allow multiple copies, but the laser printer <hostid>bamboo</hostid>'s a bit more delicate, so we will - disable multiple copies by adding the <emphasis - remap=tt>sc</emphasis> capability: + <filename>/etc/printcap</filename> file for the host <hostid>rose</hostid>. The + printer <literal>rattan</literal> is quite hearty, so + we will allow multiple copies, but the laser printer <literal>bamboo</literal>'s a bit more delicate, so we will + disable multiple copies by adding the <literal remap="tt">sc</literal> capability:</para> <programlisting> # @@ -10730,10 +10780,10 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: </programlisting> - Now, we also need to add the <emphasis - remap=tt>sc</emphasis> capability on the host orchid's + + <para>Now, we also need to add the <literal>sc</literal> capability on the host <hostid>orchid</hostid>'s <filename>/etc/printcap</filename> (and while we are at it, let - us disable multiple copies for the printer <hostid>teak</hostid>): + us disable multiple copies for the printer <literal>teak</literal>):</para> <programlisting> # @@ -10751,15 +10801,19 @@ rattan|line|diablo|lp|Diablo 630 Line Printer:\ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :lp=:rm=rose:rp=bamboo:sd=/var/spool/lpd/bamboo:sc: </programlisting> - By using the <emphasis remap=tt>sc</emphasis> + + <para>By using the <literal>sc</literal> capability, we prevent the use of <command>lpr -#</command>, but that still does not prevent users from running <citerefentry> <refentrytitle>lpr</refentrytitle></citerefentry> multiple times, or from submitting the same file multiple times - in one job like this: + in one job like this:</para> + <informalexample> <screen>&prompt.user; <userinput>lpr forsale.sign forsale.sign forsale.sign forsale.sign forsale.sign</userinput></screen> - </informalexample> There are many ways to prevent this abuse + </informalexample> + + <para>There are many ways to prevent this abuse (including ignoring it) which you are free to explore.</para> </sect3> @@ -10769,29 +10823,31 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ <title>Restricting Access To Printers</title> <para>You can control who can print to what printers by using the - UNIX group mechanism and the <emphasis remap=tt>rg</emphasis> + UNIX group mechanism and the <literal>rg</literal> capability in <filename>/etc/printcap</filename>. Just place the users you want to have access to a printer in a certain - group, and then name that group in the <emphasis - remap=tt>rg</emphasis> capability.</para> + group, and then name that group in the <literal>rg</literal> capability.</para> <para>Users outside the group (including root) will be greeted with + <informalexample> <screen>lpr: Not a member of the restricted group</screen> - </informalexample> if they try to print to the controlled + </informalexample> + + if they try to print to the controlled printer.</para> - <para>As with the <emphasis remap=tt>sc</emphasis> (suppress - multiple copies) capability, you need to specify <emphasis - remap=tt>rg</emphasis> on remote hosts that also have access + <para>As with the <literal>sc</literal> (suppress + multiple copies) capability, you need to specify <literal>rg</literal> on remote hosts that also have access to your printers, if you feel it is appropriate (see section <xref linkend="printing-advanced-network-rm" remap="Printers Installed on Remote Hosts">).</para> - <para>For example, we will let anyone access the printer <hostid>rattan</hostid>, but only those in group <emphasis - remap=tt>artists</emphasis> can use <hostid>bamboo</hostid>. Here is the familiar - <filename>/etc/printcap</filename> for host rose: + <para>For example, we will let anyone access the printer + <literal>rattan</literal>, but only those in group + <literal>artists</literal> can use <literal>bamboo</literal>. Here is the familiar + <filename>/etc/printcap</filename> for host <hostid>rose</hostid>:</para> <programlisting> # @@ -10808,10 +10864,12 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: </programlisting> - Let us leave the other example - <filename>/etc/printcap</filename> file (for the host orchid) - alone. Of course, anyone on orchid can print to <hostid>bamboo</hostid>. It might be the case that we only - allow certain logins on orchid anyway, and want them to have + + <para>Let us leave the other example + <filename>/etc/printcap</filename> file (for the host <hostid>orchid</hostid>) + alone. Of course, anyone on <hostid>orchid</hostid> can print to + <literal>bamboo</literal>. It might be the case that we only + allow certain logins on <hostid>orchid</hostid> anyway, and want them to have access to the printer. Or not.</para> <note> @@ -10831,7 +10889,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ users.</para> <para>LPD enables you to limit the maximum byte size a file in a - job can be with the <emphasis remap=tt>mx</emphasis> capability. + job can be with the <literal>mx</literal> capability. The units are in BUFSIZ blocks, which are 1024 bytes. If you put a zero for this capability, there will be no limit on file size.</para> @@ -10847,9 +10905,10 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ discarded. Whether this is correct behavior is up for debate.</para> - <para>Let us add limits to our example printers <hostid>rattan</hostid> and <hostid>bamboo</hostid>. Since those artists' PostScript + <para>Let us add limits to our example printers + <literal>rattan</literal> and <literal>bamboo</literal>. Since those artists' PostScript files tend to be large, we will limit them to five megabytes. - We will put no limit on the plain text line printer: + We will put no limit on the plain text line printer:</para> <programlisting> # @@ -10873,10 +10932,11 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: </programlisting> - Again, the limits apply to the local users + + <para>Again, the limits apply to the local users only. If you have set up access to your printers remotely, remote users will not get those limits. You will need to - specify the <emphasis remap=tt>mx</emphasis> capability in the + specify the <literal>mx</literal> capability in the remote <filename>/etc/printcap</filename> files as well. See section <xref linkend="printing-advanced-network-rm" remap="Printers @@ -10897,7 +10957,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ <para>The LPD spooling system provides several ways to restrict print jobs submitted from remote hosts:</para> - <para> + <variablelist> <varlistentry><term>Host restrictions</term> <listitem> @@ -10920,16 +10980,18 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ <para>For example, here is the <filename>/etc/hosts.lpd</filename> file on the host - rose: + <hostid>rose</hostid>: <programlisting> orchid violet madrigal.fishbaum.de </programlisting> - This means rose will accept requests - from the hosts orchid, violet, and madrigal.fishbaum.de. - If any other host tries to access rose's LPD, LPD will + + This means <hostid>rose</hostid> will accept requests + from the hosts <hostid>orchid</hostid>, + <hostid>violet</hostid>, and <hostid role="fqdn">madrigal.fishbaum.de</hostid>. + If any other host tries to access <hostid>rose</hostid>'s LPD, LPD will refuse them.</para> </listitem> </varlistentry> @@ -10957,7 +11019,9 @@ madrigal.fishbaum.de <filename>minfree</filename> file for the printer <hostid>bamboo</hostid>. We examine <filename>/etc/printcap</filename> to find the spooling - directory for this printer; here is <hostid>bamboo</hostid>'s entry: + directory for this printer; here is + <hostid>bamboo</hostid>'s entry:</para> + <programlisting> bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :sh:sd=/var/spool/lpd/bamboo:sc:rg=artists:mx#5000:\ @@ -10965,14 +11029,16 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ :if=/usr/local/libexec/psif:\ :df=/usr/local/libexec/psdf: </programlisting> - The spooling directory is the given - in the <emphasis remap=tt>sd</emphasis> capability. We + + <para>The spooling directory is the given + in the <literal>sd</literal> capability. We will make three megabytes (which is 6144 disk blocks) the amount of free disk space that must exist on the - filesystem for LPD to accept remote jobs: + filesystem for LPD to accept remote jobs:</para> + <informalexample> <screen>&prompt.root; <userinput>echo 6144 > /var/spool/lpd/bamboo/minfree</userinput></screen> - </informalexample></para> + </informalexample> </listitem> </varlistentry> @@ -10981,10 +11047,8 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ <listitem> <para>You can control which remote users can print to - local printers by specifying the <emphasis - remap=tt>rs</emphasis> capability in - <filename>/etc/printcap</filename>. When <emphasis - remap=tt>rs</emphasis> appears in the entry for a + local printers by specifying the <literal>rs</literal> capability in + <filename>/etc/printcap</filename>. When <literal>rs</literal> appears in the entry for a locally-attached printer, LPD will accept jobs from remote hosts <emphasis>if</emphasis> the user submitting the job also has an account of the same login name on @@ -11004,7 +11068,7 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ </listitem> </varlistentry> </variablelist> - </para> + </sect3> </sect2> @@ -11095,17 +11159,16 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ starts the text and the conversion filters with the name of the accounting file to use on the filter command line. The filters can use this argument to know where to write an accounting file - entry. The name of this file comes from the <emphasis - remap=tt>af</emphasis> capability in + entry. The name of this file comes from the <literal>af</literal> capability in <filename>/etc/printcap</filename>, and if not specified as an absolute path, is relative to the spooling directory.</para> <para>LPD starts <command>lpf</command> with page width - and length arguments (from the <emphasis remap=tt>pw</emphasis> - and <emphasis remap=tt>pl</emphasis> capabilities). <command>lpf</command> uses these arguments to determine how + and length arguments (from the <literal>pw</literal> + and <literal>pl</literal> capabilities). <command>lpf</command> uses these arguments to determine how much paper will be used. After sending the file to the printer, it then writes an accounting entry in the accounting file. The - entries look like this: + entries look like this:</para> <programlisting> 2.00 rose:andy @@ -11113,7 +11176,8 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ 3.00 orchid:mary 5.00 orchid:mary 2.00 orchid:zhang</programlisting> - You should use a separate accounting file for + + <para>You should use a separate accounting file for each printer, as <command>lpf</command> has no file locking logic built into it, and two <command>lpf</command>s might corrupt each other's entries if they were to write to the same file at the same time. A easy way @@ -11121,17 +11185,16 @@ bamboo|ps|PS|S|panasonic|Panasonic KX-P4455 PostScript v51.4:\ <literal>af=acct</literal> in <filename>/etc/printcap</filename>. Then, each accounting file will be in the spooling directory for a printer, in a file named - <emphasis remap=tt>acct</emphasis>.</para> + <filename>acct</filename>.</para> <para>When you are ready to charge users for printouts, run - the</para> - - <para><citerefentry> + the <citerefentry> <refentrytitle>pac</refentrytitle></citerefentry> program. Just change to the spooling directory for the printer you want to collect on and type <citerefentry> <refentrytitle>pac</refentrytitle></citerefentry>. You - will get a dollar-centric summary like the following: + will get a dollar-centric summary like the following:</para> + <informalexample> <screen> Login pages/feet runs price orchid:kelly 5.00 1 $ 0.10 @@ -11143,15 +11206,18 @@ rose:mary 87.00 32 $ 1.74 rose:root 26.00 12 $ 0.52 total 337.00 154 $ 6.74</screen> - </informalexample> These are the arguments <citerefentry> + </informalexample> + + <para>These are the arguments <citerefentry> <refentrytitle>pac</refentrytitle></citerefentry> - expects: + expects:</para> + <variablelist> <varlistentry><term><option>-P<replaceable>printer</replaceable></option></term> <listitem> - <para>Which <emphasis remap=it>printer</emphasis> to + <para>Which <replaceable>printer</replaceable> to summarize. This option works only if there is an - absolute path in the <emphasis remap=tt>af</emphasis> + absolute path in the <literal>af</literal> capability in <filename>/etc/printcap</filename>.</para> </listitem> </varlistentry> @@ -11168,8 +11234,8 @@ total 337.00 154 $ 6.74</screen> <listitem> <para>Ignore host name in the accounting files. With this - option, user smith on host alpha is the same user smith - on host gamma. Without, they are different + option, user <username>smith</username> on host <hostid>alpha</hostid> is the same user <username>smith</username> + on host <hostid>gamma</hostid>. Without, they are different users.</para> </listitem> </varlistentry> @@ -11177,13 +11243,10 @@ total 337.00 154 $ 6.74</screen> <varlistentry><term><option>-p<replaceable>price</replaceable></option></term> <listitem> - <para>Compute charges with <emphasis - remap=it>price</emphasis> dollars per page or per foot - instead of the price from the <emphasis - remap=tt>pc</emphasis> capability in + <para>Compute charges with <replaceable>price</replaceable> dollars per page or per foot + instead of the price from the <literal>pc</literal> capability in <filename>/etc/printcap</filename>, or two cents (the - default). You can specify <emphasis - remap=it>price</emphasis> as a floating point + default). You can specify <replaceable>price</replaceable> as a floating point number.</para> </listitem> </varlistentry> @@ -11203,24 +11266,23 @@ total 337.00 154 $ 6.74</screen> </listitem> </varlistentry> - <varlistentry><term><emphasis - remap=tt><replaceable>names...</replaceable></emphasis></term> + <varlistentry><term><replaceable>name</replaceable> <replaceable>…</replaceable></term> <listitem> <para>Print accounting information for the given user - <emphasis remap=it>names</emphasis> only.</para> + <replaceable>names</replaceable> only.</para> </listitem> </varlistentry> </variablelist> - </para> <para>In the default summary that <citerefentry> <refentrytitle>pac</refentrytitle></citerefentry> produces, you see the number of pages printed by each user from various hosts. If, at your site, host does not matter (because users can use any host), run <command>pac -m</command>, to - produce the following summary: + produce the following summary:</para> + <informalexample> <screen> Login pages/feet runs price andy 2.00 1 $ 0.04 @@ -11230,10 +11292,12 @@ root 26.00 12 $ 0.52 zhang 9.00 1 $ 0.18 total 337.00 154 $ 6.74</screen> - </informalexample> To compute the dollar amount due, + </informalexample> + + <para>To compute the dollar amount due, <citerefentry> <refentrytitle>pac</refentrytitle></citerefentry> uses - the <emphasis remap=tt>pc</emphasis> capability in the + the <literal>pc</literal> capability in the <filename>/etc/printcap</filename> file (default of 200, or 2 cents per page). Specify, in hundredths of cents, the price per page or per foot you want to charge for printouts in this @@ -11243,16 +11307,19 @@ total 337.00 154 $ 6.74</screen> the <option>-p</option> option. The units for the <option>-p</option> option are in dollars, though, not hundredths of cents. For example, + <informalexample> <screen>&prompt.root; <userinput>pac -p1.50</userinput></screen> - </informalexample> makes each page cost one dollar and fifty + </informalexample> + + makes each page cost one dollar and fifty cents. You can really rake in the profits by using this option.</para> <para>Finally, running <command>pac -s</command> will save the summary information in a summary accounting file, which is named the same as the printer's accounting file, but with - <symbol>_sum</symbol> appended to the name. It then truncates + <literal>_sum</literal> appended to the name. It then truncates the accounting file. When you run <citerefentry> <refentrytitle>pac</refentrytitle></citerefentry> again, it rereads the summary file to get starting totals, then @@ -11328,7 +11395,8 @@ total 337.00 154 $ 6.74</screen> <para>Unfortunately, I have located only <emphasis>two</emphasis> alternatives---and they are almost identical to each other! They - are: + are:</para> + <variablelist> <varlistentry><term>PLP, the Portable Line Printer Spooler System</term> @@ -11384,7 +11452,6 @@ total 337.00 154 $ 6.74</screen> </listitem> </varlistentry> </variablelist> - </para> </sect1> @@ -11394,7 +11461,7 @@ total 337.00 154 $ 6.74</screen> <para>I would like to thank the following people who have assisted in the development of this document:</para> - <para> + <variablelist> <varlistentry><term>Daniel Eischen <email>deischen@iworks.interworks.org</email></term> @@ -11421,10 +11488,6 @@ total 337.00 154 $ 6.74</screen> </varlistentry> </variablelist> - </para> - - <para></para> - </sect1> </chapter> @@ -28004,7 +28067,7 @@ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Date created: 5 December 1994 # Whom: asami # -# $Id: handbook.sgml,v 1.37 1998-10-21 21:58:40 nik Exp $ +# $Id: handbook.sgml,v 1.38 1998-10-21 22:00:19 nik Exp $ # DISTNAME= oneko-1.1b |
